fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <map>
  4. using namespace std;
  5.  
  6. int main() {
  7. // your code goes here
  8. map<string,int> printMap = {{"100",1}, {"a",8},{"about",4}};
  9. for(auto pos = printMap.begin(); pos != printMap.end(); pos++)
  10. {
  11. cout << left << pos->first << " " << right << ": " << pos->second << " ";
  12. }
  13. return 0;
  14. }
Success #stdin #stdout 0s 3476KB
stdin
Standard input is empty
stdout
100 :  1    a :  8    about :  4