fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. map<char,int>mp{
  6.  
  7. {'T',9},
  8. {'S',8},
  9. {'U',7}
  10. };
  11. mp['F']=10;
  12. mp.insert(pair<char,int>('J',5));
  13. pair<char,int>P1('H',6);
  14. pair<char,int>P2('I',1);
  15. mp.insert(P2);
  16. mp.insert(P1);
  17. // mp.erase(P1.second);
  18. // cout<<mp['I']<<" "<<mp['H']<<" "<<P1.first<<" "<<P2.second;
  19. for(map<char,int>::iterator itr=mp.begin();itr!=mp.end();itr++)
  20. {
  21. cout<<itr->first<<"->";
  22. cout<<itr->second<<endl;
  23. }
  24.  
  25.  
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0.01s 5532KB
stdin
Standard input is empty
stdout
F->10
H->6
I->1
J->5
S->8
T->9
U->7