1082 射击比赛 较简单
作者:互联网
代码
#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
using namespace std;
int main()
{
int n;
string id;
float x,y;
float p;
float max=-1;
float min=9999;
string maxid,minid;
cin>>n;
for(int i=0;i<n;i++){
cin>>id>>x>>y;
p=sqrt(x*x+y*y);
if(max<p){
max=p;
maxid=id;
}
if(min>p){
min=p;
minid=id;
}
}
cout<<minid<<" "<<maxid;
return 0;
}
标签:1082,min,int,float,minid,射击,include,id,比赛 来源: https://www.cnblogs.com/wodeblog1982/p/16473420.html