You are viewing a single comment's thread. Return to all comments →
I had the same problem, thanks for the heads up. Here's my final solution.
int main() { long long T; string query; cin >> T; map <string, string> phonebook; while(T--){ string name, phonenumber; cin >> name >> phonenumber; phonebook[name] = phonenumber; } while(cin >> query){ if (phonebook[query] != "") cout << query << "=" << phonebook[query] << endl; else cout << "Not found" << endl; } return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 8: Dictionaries and Maps
You are viewing a single comment's thread. Return to all comments →
I had the same problem, thanks for the heads up. Here's my final solution.