PTA_考试座位号
#include<bits/stdc++.h>
using namespace std;
struct test
{
string ID;
int a;
int b;
};
int main()
{
int N;
cin >> N;
struct test* test1 = new struct test [N];
for (int i = 0; i < N; i++)
{
cin >> test1[i].ID;
cin >> test1[i].a >> test1[i].b;
}
int num; int* num2 = new int[1002];
cin >> num;
for (int i = 0; i < num; i++)
{
cin >> num2[i];
}
for (int i = 0; i < num; i++)
{
for (int k = 0; k < N; k++)
{
if (num2[i] == test1[k].a)
{
cout <<test1[k].ID<< " " << test1[k].b<<endl;
}
}
}
}