提交时间:2024-01-13 13:11:02
运行 ID: 36396
#include<bits/stdc++.h> using namespace std; struct node{ string name; int score; }a[1000]; bool cmp(node A,node B){ return A.score>B.score; } int main(){ int n; cin>>n; for(int i=0;i<n;i++) cin>>a[i].name>>a[i].score; sort(a,a+n,cmp); for(int i=0;i<n;i++) cout<<a[i].name<<a[i].score; return 0; }