文章
61
粉丝
137
获赞
18
访问
38.5k
#include<bits/stdc++.h>
using namespace std ;
struct node {
string id ;
string name ;
string sex ;
string age ;
} ;
int main() {
int n ;
cin >> n ;
node tmp ;
map <string ,node> students ;
for(int i = 0 ;i < n ;i++){
cin >> tmp.id >> tmp.name >> tmp.sex >> tmp.age ;
students[tmp.id] = tmp ;
}
int m ;
string seach_id ;
map<string, node>::iterator it;
cin >> m ;
for(int i = 0 ;i < m ;i++){
cin >> seach_id ;
it = students.find(seach_id);
if(it != students.end()){
cout << it->second.id << " " << it->second.name << " " << it->second.sex << " " <<it->second.age << endl ;
}else cout << "No Answer!" << endl;
}
return 0 ;
}
登录后发布评论
暂无评论,来抢沙发