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