You are viewing a single comment's thread. Return to all comments →
Has anyone else had problems with test case 1 with C++? In the other test cases my code is fine
This is my code in case someone tells me my error.
int main() { map<string, string> mapa; string name, phone; int temp; cin >> temp; for (int i = 0; i < temp; i++) { cin >> name >> phone; mapa[name] = phone; } for (int i = 0; i < temp; i++) { cin >> name; if ( mapa.find(name) != mapa.end() ) { cout << name << "=" << mapa[name] << endl; } else { cout << "Not found\n"; } } 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 →
Has anyone else had problems with test case 1 with C++? In the other test cases my code is fine
This is my code in case someone tells me my error.