标签:
#include <iostream>
using namespace std;
struct student
{
char num[20];
int shi;
int kao;
};
int main()
{
student stu[1000];
int n, q, b[1000];
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> stu[i].num >> stu[i].shi >> stu[i].kao;
}
cin >> q;
for (int j = 0; j < q; j++)
cin >> b[j];
for (int j = 0; j < q; j++)
{
for (int i = 0; i < n; i++)
{
if (b[j] == stu[i].shi)
{
cout << stu[i].num << " " << stu[i].kao << endl;
break;
}
}
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/code666/p/5840525.html