Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
127607 | 罗恩祥 | 神族文字 | C++ | 通过 | 100 | 681 MS | 16636 KB | 572 | 2024-01-25 09:39:12 |
#include <bits/stdc++.h> using namespace std; int main() { map <string,string> lst; int idx = 1; string str; while(true) { getline(cin,str); if(str==""){ break; } string s1,s2; int M = 0; for(int i = 0;i < str.size();i++) { if(str[i] == ' ') { M = i; break; } } for(int i = 0;i < M;i++) s1 += str[i]; for(int i = M + 1;i < str.size();i++) s2 += str[i]; lst[s2] = s1; } string s; while(cin>>s) { if(lst[s] == "") cout << "eh" << endl; else cout << lst[s] << endl; } }