fork download
  1. #include <iostream>
  2. #include <utility>
  3. #include <vector>
  4.  
  5. int main()
  6. {
  7. std::vector<std::pair<int, int>> v({{1,2}, {1,3}, {1,4}});
  8. for (const auto & p : v)
  9. {
  10. std::cout << "[" << p.first << ", " << p.second << "]\n";
  11. }
  12. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
[1, 2]
[1, 3]
[1, 4]