Submit Time:2024-01-25 09:12:10
运行 ID: 127469
#include <bits/stdc++.h> using namespace std; map<string, string> mp; string key[100010], word, haha[100010]; int main (){ ios::sync_with_stdio(false); cin.tie(0); int x = 1; while (true){//cat duolij getline(cin, haha[x]); if (haha[x] == "") break; int p = haha[x].find(' '); key[x] = haha[x].substr(p + 1, haha[x].size() - p - 1); mp[key[x]] = haha[x].substr(0, p); x++; } while (cin >> word){ if (mp[word] == "") cout << "eh" << endl; else cout << mp[word] << endl; } return 0; }