fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <utility>
  4. using namespace std;
  5.  
  6. int main() {
  7. auto A = vector<pair<int,int>>{{0,0},{1,1},{2,2},{3,3}};
  8. auto it= A.begin();
  9. auto it2= it+1;
  10.  
  11. for ( ; it != A.end()-1; it++ )
  12. {
  13. cout << it->first << " " << it2->first << "\n";
  14. it2++;
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
0 1
1 2
2 3