测试点只过了9个,还有一个错了,求助大佬qwq
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
struct student{
string name;
int fen;
};
bool mhy(student x,student y)
{
return x.fen>=y.fen;
}
int main()
{
student fall[30];
int a;
cin>>a;
for(int i=0;i<a;i++)
{
cin>>fall[i].name;
cin>>fall[i].fen;
}
sort(fall,fall+a,mhy);
for(int i=0;i<a;i++)
{
cout<<fall[i].name<<" ";
cout<<fall[i].fen<<endl;
}
return 0;
}