View Code of Problem 83

#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
struct Stu{
    int a,b;
}stu[999];
bool cmp(Stu p,Stu q){
    return p.a<q.a;
}
int main(){
    int n,m;
    cin>>n>>m;
    for(int i=0;i<n+m;i++){
        cin>>stu[i].a>>stu[i].b;
    }
    sort(stu,stu+n+m,cmp);
    for(int i=0;i<n+m;i++)
        cout<<stu[i].a<<" "<<stu[i].b<<endl;
    return 0;
}

Double click to view unformatted code.


Back to problem 83