You are viewing a single comment's thread. Return to all comments →
int main() { int q; cin >> q; string name; map<string,int> notes; for(int i(0),type(0),note(0) ; i<q ; ++i) { cin>>type>>name; switch(type) { case 1:{ cin>>note; notes[name] += note; break; } case 2: notes[name] = 0; break; case 3: cout << notes[name] << endl; break; } } return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Maps-STL
You are viewing a single comment's thread. Return to all comments →