You are viewing a single comment's thread. Return to all comments →
Failing on test case 2, I don't understand why?
int main() { int N, i; string name; int num; map<string, int> phonebook; cin >> N; for(i=0;i<N;i++){ cin >> name; cin >> num; phonebook[name] = num; } for(i=0;i<N;i++){ cin >> name; if(phonebook.count(name)){ cout << name << "=" << phonebook[name] << 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 →
Failing on test case 2, I don't understand why?