文章
13
粉丝
171
获赞
8
访问
46.6k
#include <iostream>
#include <map>
#include <string.h>
using namespace std;
struct Student {
string id;
string name;
string sex;
int age;
};
int main() {
int n;
int m;
while (cin >> n) {
map<string, Student> M;
for (int i = 0; i < n; i++) {
Student tmp;
cin >> tmp.id >> tmp.name >> tmp.sex >> tmp.age;
M[tmp.id] = tmp;
}
cin >> m;
string find_id;
for (int i = 0; i < m; i++) {
cin >> find_id;
if (M.find(find_id) != M.end())
cout << M[find_id].id << ' ' << M[find_id].name << ' ' << M[find_id].sex << ' ' << M[find_id].age
<< endl;
else
cout << "No Answer!" << endl;
}
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发