文章
211
粉丝
0
获赞
927
访问
31.3k
#include<bits/stdc++.h>
using namespace std;
struct node{
string name;
int age;
double score;
};
bool cmp(node a,node b){
if(a.score != b.score)
return a.score < b.score;
else if(a.name != b.name)
return a.name < b.name;
else
return a.age < b.age;
}
int main(){
int n;
while(cin >> n){
vector<node> a(n);
for(int i=0;i<n;i++)
cin >> a[i].name >> a[i].age >> a[i].score;
sort(a.begin(),a.end(),cmp);
for(auto it:a)
cout << it.name << " " << it.age << " " << it.score << endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发