• + 1 comment

    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;
    }