You are viewing a single comment's thread. Return to all comments →
int main() { int q, type; cin >> q; map<string,int> clas; string name; for (int i(0), mark; i<q; ++i) { cin >> type >> name; if (type == 1){ cin >> mark; clas[name] += mark; } else if (type == 2) clas.erase(name); else cout << clas[name] << "\n"; } 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 →