fork download
  1. #include <iostream>
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. unordered_map<int,int> m;
  7. m[1] = 1;
  8. for (unordered_map<int,int>::iterator it = m.begin(); it != m.end(); ++it) {
  9. cout<<it->first<<" "<<it->second<<endl;
  10. }
  11. cout<<"here"<<endl;
  12. if (m[2]) {
  13. m[1] = 3;
  14. }
  15. for (unordered_map<int,int>::iterator it = m.begin(); it != m.end(); ++it) {
  16. cout<<it->first<<" "<<it->second<<endl;
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0s 5428KB
stdin
Standard input is empty
stdout
1 1
here
2 0
1 1