1063 计算谱半径 较简单

注意点

开方用到cmath

代码

#include <iostream>
#include <cstdio>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
	int n;
	int a,b;
	float tmp;
	float max=-1;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a>>b;
		tmp=sqrt(a*a+b*b);
		if(max<tmp){
			max=tmp;
		}
	}
	cout<<fixed<<setprecision(2)<<max;
	return 0;
}
posted @ 2022-07-11 19:37  qwasdasd  阅读(40)  评论(0)    收藏  举报