You are viewing a single comment's thread. Return to all comments →
#include<iostream> #include<map> #include<string> int main() { std::map<std::string, int> m={}; std::string s; int a, b; std::cin>>a; while(a--) { std::cin>>b; std::cin>>s; switch(b) { case 1: std::cin>>b; m[s]+=b; break; case 2: m.erase(s); break; case 3: std::cout<<m[s]<<"\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 →