参考代码:
#include<iostream> #include<string> #include<algorithm> #include<stdio.h> using namespace std; struct student { int sno; int score; } stu[1001]; bool sort_rule(student a, student b) { return a.sno<b.sno; } int main() { int m,n; cin>>m>>n; for(int i=0; i<m+n; i++) { scanf("%d %d", &stu[i].sno, &stu[i].score); }; sort(stu,stu+m+n,sort_rule); for(int i=0; i<m+n; i++) { cout<<stu[i].sno<<' '; cout<<stu[i].score<<endl; } return 0; }
0.0分
0 人评分
计算质因子 (C++代码)浏览:1677 |
C语言程序设计教程(第三版)课后习题7.2 (C语言代码)浏览:557 |
Tom数 (C语言代码)浏览:536 |
C二级辅导-进制转换 (C语言代码)浏览:686 |
C语言程序设计教程(第三版)课后习题11.8 (C语言代码)浏览:1007 |
拆分位数 (C语言代码)浏览:446 |
C二级辅导-公约公倍 (C语言代码)浏览:667 |
DNA (Java代码)浏览:950 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:580 |
C语言训练-求素数问题 (C语言代码)浏览:617 |