fork download
  1. #include <iostream>
  2. #include <map>
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. map<pair<int, int>, int> mp;
  8.  
  9. mp.insert({ { 2, 3 }, 8 });
  10. mp.insert({ { 2, 5 }, 5 });
  11. mp.insert({ { 7, 1 }, 3 });
  12. mp.insert({ { 9, 3 }, 1 });
  13. mp.insert({ { 5, 0 }, 3 });
  14.  
  15. for (auto key : mp) {
  16. std::cout << "<" << key.first.first << ", " << key.first.second << "> | ";
  17. }
  18. cout << "\n";
  19.  
  20. // your code goes here
  21. return 0;
  22. }
Success #stdin #stdout 0s 4504KB
stdin
Standard input is empty
stdout
<2, 3> | <2, 5> | <5, 0> | <7, 1> | <9, 3> |