#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; }
时间: 2024-12-19 22:18:18