fork download
  1. #include <iostream>
  2. #include <map>
  3.  
  4. int main() {
  5. std::map<std::string, std::string> map;
  6. map["one"] = "first";
  7. map["two"] = "second";
  8. map["three"] = "third";
  9. map["four"] = "fourth";
  10. for (std::map<std::string, std::string>::const_iterator it = map.begin(); it != map.end(); ++it) {
  11. std::cout << it->first << ": " << it->second << std::endl;
  12. }
  13. return 0;
  14. }
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
four: fourth
one: first
three: third
two: second