文章
2
粉丝
0
获赞
9
访问
588
有无大佬帮忙看看,本地没问题,为什么提交的时候,一会过了,一会没过啊?
#include <sstream>
#include <iostream>
#include <unordered_map>
using namespace std;
unordered_map<string, string> stu;
int main() {
int n, m;
cin >> n;
getchar();
while (n -- ) {
string str, id;
getline(cin, str);
stringstream ss(str);
ss >> id;
stu.insert({id, str});
// cout << str << endl;
// cout << id <<endl;
}
cin >> m;
while (m -- ) {
string id;
cin >> id;
if(stu.count(id)) cout << stu[id] << endl;
else cout << "No Answer!" << endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发