#include<stdio.h>
#include<iostream>
#include<string>
using namespace std;
struct StudentInfo {
string ID;
int testID, formalID;
}StudentInfo[1010];
int main() {
int n, m, a;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> StudentInfo[i].ID >> StudentInfo[i].testID >> StudentInfo[i].formalID;
}
cin >> m;
for (int i = 0; i < m; i++) {
cin >> a;
for (int j = 0; j < n; j++) {
if (a == StudentInfo[j].testID) cout << StudentInfo[j].ID << ‘ ‘ << StudentInfo[j].formalID << endl;
}
}
return 0;
}
原文地址:https://www.cnblogs.com/Yaxadu/p/10364540.html
时间: 2024-10-10 00:53:25