题解
2025-07-17 17:48:49
发布于:江苏
2阅读
0回复
0点赞
#include<iostream>
#include<algorithm>
using namespace std;
struct people{
string name;
int high,id;
}a[110];
bool cmp(people a,people b){
if(a.high!=b.high){
return a.high>b.high;
}else{
return a.id<b.id;
}
}
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>a[i].name>>a[i].high>>a[i].id;
}
sort(a,a+n,cmp);
cout<<a[0].name<<' '<<a[0].high<<' '<<a[0].id;
return 0;
}
这里空空如也
有帮助,赞一个