Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement