#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>using namespace std;struct shujupaixu{ int xuhao ; int shuju ; int num ;};bool cmp ( shujupaixu a , shujupaixu b ){ return a.shuju < b.shuju ; if( a.shuju == b. shuju ) { return a.xuhao < b.xuhao ; }}int main(){ shujupaixu arr[100001]; int i = 0 , j = 0 ; while(scanf( "%d %d" , &arr[i].xuhao , &arr[i].shuju ) != EOF) { i ++ ; arr[i].num = i ; } sort ( arr , arr+i , cmp ) ; for ( j = 0 ; j < i ; j ++ ) { printf ( "%d %d\n" , arr[j].xuhao , arr[j].shuju ) ; } return 0 ;}
- 1 回答
- 0 关注
- 1412 浏览
添加回答
举报
0/150
提交
取消