提交时间:2024-03-02 15:30:18
运行 ID: 134305
#include<bits/stdc++.h> using namespace std; struct st{ int x; int y; }; st l[100001]; bool cmp(st m,st n){ if(m.x>n.x){ return 0; } if(m.x==n.x&&m.y>n.y){ return 0; } return 1; } int main(){ int a; cin>>a; for(int i=1;i<=a;i++) cin>>l[i].x>>l[i].y; sort(l+1,l+a+1,cmp); for(int i=1;i<=a;i++) cout<<l[i].x<<" "<<l[i].y<<endl; }