https://pintia.cn/problem-sets/994805260223102976/problems/994805267860930560
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int N, tmp1, tmp2;
double max = 0.0;
cin >> N;
for(int i = 0; i < N; i++){
cin >> tmp1 >> tmp2;
max = (max > sqrt(tmp1*tmp1 + tmp2*tmp2)) ? max : (sqrt(tmp1*tmp1 + tmp2*tmp2));
}
printf("%.2f", max);
return 0;
}
本文介绍了一个使用C++实现的程序,该程序读取一组二维坐标,并计算这些坐标之间的最大欧氏距离。通过输入坐标数量及各坐标的横纵坐标值,程序能够输出计算得到的最大距离。
1809

被折叠的 条评论
为什么被折叠?



