PAT basic 1041

来源:互联网 发布:seo什么意思 编辑:程序博客网 时间:2024/05/21 17:15
#include <iostream>#include <vector>using namespace std;struct stu {    string s;    int one, two;};int main() {    int n, m, temp;    cin >> n;    vector<stu> a(n);    for (int i = 0; i < n; i++) {        cin >> a[i].s >> a[i].one >> a[i].two;    }    cin >> m;    for (int i = 0; i < m; i++) {        cin >> temp;        for (int j = 0; j < n; j++) {            if (a[j].one == temp) {                cout << a[j].s << " " << a[j].two << endl;                break;            }        }    }    return 0;}