提交时间:2024-01-13 14:10:06
运行 ID: 36431
#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=1;i<n;i++){ cout<<a[i].name<<" "<<a[i].score<<endl; } return 0; }