标签:code 射击 ace bool names main can std space
水提水题,直接贴代码啦
#include<cstdio>
#include<algorithm>
using namespace std;
struct ppp{
int id;
int juli;
}arr[10005];
bool cmp(ppp A,ppp B){
return A.juli<B.juli;
}
int main(){
int N;scanf("%d",&N);
for(int i=0;i<N;i++){
int id,x,y;
scanf("%d %d %d",&id,&x,&y);
arr[i].id=id;arr[i].juli=x*x+y*y;
}
sort(arr,arr+N,cmp);
printf("%04d %04d",arr[0].id,arr[N-1].id);
return 0;
}
标签:code 射击 ace bool names main can std space
原文地址:https://www.cnblogs.com/hebust/p/9490282.html