/**
* 1.本题解析:见注释。
*
* 2.参考博客:https://www.liuchuo.net/archives/2746
**/
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int n;
scanf("%d", &n);
//max保存谱半径
float max = 0;
for(int i = 0; i < n; i++) {
float a, b, ans;
//将ans的最大值保存在max中
scanf("%f%f", &a, &b);
ans = sqrt(a * a + b * b);
max = ans > max ? ans : max;
}
//最后用%.2f输出max的值
printf("%.2f", max);
return 0;
}
1063 计算谱半径
最新推荐文章于 2022-08-12 09:02:31 发布