fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6.  
  7. map<string,int>mp{{"abid",19},{"n",3}};
  8.  
  9. auto it = mp.begin();
  10.  
  11. mp.erase(it);
  12. it++;
  13. cout<<mp.begin()->first<<" "<<mp.begin()->second<<"ffff"<<endl;
  14.  
  15. cout<<it->first<<" "<<it->second<<endl;
  16.  
  17.  
  18. for(auto& a:mp)
  19. {
  20. cout<<a.first<<" "<<a.second<<'\n';
  21. }
  22. cout<<endl;
  23.  
  24. // map<int,string>mp;
  25.  
  26. // if(mp[36]=="") cout<<"yes"<<endl;
  27.  
  28. // for(auto& a:mp)
  29. // {
  30. // cout<<a.first<<" "<<a.second<<'\n';
  31. // }
  32.  
  33.  
  34.  
  35.  
  36. }
  37.  
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
n 3ffff
n 3
n 3