emmm
1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <iostream> 4 using namespace std; 5 struct student 6 { 7 int num; 8 int score; 9 struct student *next; 10 }*head; 11 int main() 12 { 13 int n,m,l,nu,sc; 14 cin>>n>>m; 15 l=n+m; 16 head=new student; 17 head->next=NULL; 18 struct student *q,*p,*k; 19 p=head; 20 while(l--){ 21 q=new student; 22 q->next=NULL; 23 cin>>nu>>sc; 24 p->num=nu; 25 p->score=sc; 26 p->next=q; 27 p=q; 28 } 29 k=head; 30 while(k->next!=NULL){ 31 cout<<k->num<<" "<<k->score<<endl; 32 k=k->next; 33 } 34 return 0; 35 }