1082 射击比赛 (20 分)

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    scanf("%d",&n);
    char maxn[5],minn[5],m[5];
    int max1=-1,min1=100010,x,y;
    while(n--)
    {
        cin>>m>>x>>y;
        if(sqrt(x*x+y*y)>max1){
            max1=sqrt(x*x+y*y);
            strcpy(maxn,m);
        }
        if(sqrt(x*x+y*y)<min1){
            min1=sqrt(x*x+y*y);
            strcpy(minn,m);
        }
    }
    cout<<minn<<" "<<maxn<<endl;
    return 0;
}

 

posted @ 2019-03-04 13:10  Tonyyy  阅读(159)  评论(0编辑  收藏  举报