PAT.B1041考试座位号_#include

题意

注意点

  1. 16位数字用long long 存储
  2. 使用结构体,stu的下标为试机座位号
#include <bits/stdc++.h>
using namespace std;

struct Student{
long long id;
int seat;
}stu[1010];

int main(){
int n=4;
scanf("%d",&n);
while(n--){
long long tid;
int tpos,tseat;
scanf("%lld %d %d",&tid,&tpos,&tseat);
stu[tpos].id=tid;stu[tpos].seat=tseat;
}
scanf("%d",&n);
while(n--){
int tpos;
scanf("%d",&tpos);
printf("%lld %d\n",stu[tpos].id,stu[tpos].seat);
}
return 0;
}