1082 射击比赛 (20 分)

#include 
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<" "<endl;
    return 0;
}

 

转载于:https://www.cnblogs.com/tonyyy/p/10470091.html

你可能感兴趣的:(1082 射击比赛 (20 分))