题解在此
2025-08-06 17:43:25
发布于:浙江
11阅读
0回复
0点赞
#include <iostream>
#include <algorithm>
using namespace std;
struct node{
    string xm;
    int sg,cxdnf;
}a[110];
bool cmp(node x,node y){
    if (x.sg!=y.sg){
        return x.sg>y.sg;
    }else{
        return x.cxdnf<y.cxdnf;
    }
}
int main(){
    int n;
    cin>>n;
    for (int i=1;i<=n;i++){
        cin>>a[i].xm>>a[i].sg>>a[i].cxdnf;
    }
    sort(a+1,a+1+n,cmp);
    cout<<a[1].xm<<" "<<a[1].sg<<" "<<a[1].cxdnf;
    return 0;
}
这里空空如也







有帮助,赞一个