词典 (noi OpenJudge)
传送门:1806:词典
神奇的STL
#include <iostream> #include <cstdio> #include <cstring> #include <map> #include <sstream> using namespace std; string s, s1, s2, word; map <string, string> dic; int main() { while (getline (cin, s) && s != "") { stringstream sin (s); sin >> s1 >> s2; dic [s2] = s1; } while (cin >> word) { if (dic [word] == "") cout << "eh" << endl; else cout << dic [word] << endl; } return 0; }
myj 吊打我Orz,xxy 捆起来打我Orz,myl 文化课上天Orz, lrh 姿势水平敲高Orz, hkd 特别胖Orz%%%,cys 智商感人Orz,syl zz专业Orz,我没有学上, 我们未来一片光明