fork download
  1. #include <iostream>
  2. #include <map>
  3. using namespace std;
  4.  
  5. int main() {
  6. std::map<std::string, double> counts;
  7. counts["cats"] = 5;
  8. counts["dogs"] = 77;
  9.  
  10. for( auto it = counts.begin(); it != counts.end(); it++) {
  11. std::cout << "There are " << it->second << ' ' << it->first << std::endl;
  12. }
  13. return 0;
  14. }
Success #stdin #stdout 0s 4288KB
stdin
Standard input is empty
stdout
There are 5 cats
There are 77 dogs