fork(30) download
  1. #include <map>
  2. #include <iostream>
  3.  
  4. int main()
  5. {
  6. std::map<int, int> foobar({{1,1}, {2,2}, {3,3}});
  7. for(auto& p : foobar) {
  8. ++p.second;
  9. std::cout << '{' << p.first << ", " << p.second << "} ";
  10. }
  11. std::cout << std::endl;
  12. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
{1, 2} {2, 3} {3, 4}