//本着解题的原则,未严格按照题目要求,提供给大家一种思路,大神路过就行,谢谢
#include <iostream>
#include <algorithm>
using namespace std;
struct student{
int number;
float score;
};
int main ()
{
int n,m;
cin>>n>>m;
int *p=new int [n+m];
student *stu=new student [n+m];
for(int i=0;i<n+m;i++){
cin>>(*(stu+i)).number>>(*(stu+i)).score;
*(p+i)=(*(stu+i)).number;
}
sort(p,p+n+m);
for(int i=0;i<n+m;i++){
cout<<*(p+i)<<" ";
for(int j=0;j<n+m;j++){
if((*(stu+j)).number==*(p+i)){
cout<<(*(stu+j)).score;
break;
}
}
cout<<endl;
}
return 0;
}
0.0分
0 人评分
C二级辅导-公约公倍 (C语言代码)浏览:817 |
点我有惊喜!你懂得!浏览:4104 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:635 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:653 |
简单的a+b (C语言代码)浏览:489 |
C二级辅导-计负均正 (C语言代码)浏览:647 |
printf基础练习2 (C语言代码)浏览:567 |
C语言程序设计教程(第三版)课后习题8.4 (C语言代码)浏览:611 |
2004年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:1326 |
【明明的随机数】 (C语言代码)浏览:785 |