#include <iostream>
#include <algorithm>
using namespace std;
struct stu{
string name;
int money;
}students[101];
bool cmp(stu a,stu b){
return a.money > b.money;
}
int main(){
int n;
cin>>n;
for(int i = 0;i < n;i++){
cin>>students[i].name>>students[i].money;
}
sort(students,students + n,cmp);
for(int i = 0;i < n;i++){
if(students[i].money == students[0].money){
cout<<students[i].name<<" "<<students[i].money<<endl;
}
}
return 0;
}
/*5
zhangze 380
zhuhaomiao 1250
tiansen 2500
zhaoyatao 6666
yangxueqing 6666*/
【压岁钱】
最新推荐文章于 2024-11-15 18:38:47 发布