fork(1) download
  1. #include <iostream>
  2. #include <map>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. std::map<string, int> testMap;
  9.  
  10. testMap["5"] = 5;
  11. testMap["10"] = 10;
  12. testMap["1"] = 1;
  13.  
  14. for (const std::pair<const std::string, int>& it : testMap)
  15. {
  16. std::cout << it.first << " - " << it.second << '\n';
  17. }
  18.  
  19. for (const auto& it : testMap)
  20. {
  21. std::cout << it.first << " - " << it.second << '\n';
  22. }
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
1 - 1
10 - 10
5 - 5
1 - 1
10 - 10
5 - 5