本文共 486 字,大约阅读时间需要 1 分钟。
传送门:
神奇的STL
#include #include #include #include #include using namespace std;string s, s1, s2, word;map 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;}
转载于:https://www.cnblogs.com/ZlycerQan/p/6158314.html