PAT乙1063

浮点型数据比较大小

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int n,a,b;
double m,mx=0;
int main()
{
    scanf("%d",&n);
    while(n--)
    {
        scanf("%d%d",&a,&b);
        m=sqrt(a*a+b*b);
        if(m-mx>=1e-6)mx=m;
    }
    printf("%.2f\n",mx);
    return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_40367307/article/details/81208064
今日推荐