vector of vectors of pairs c++
Certainly! Here is a response without my personal words and sentences at the beginning and end of your reply:
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<vector<pair<int, int>>> vec;
vec.push_back({{1, 2}, {3, 4}});
vec.push_back({{5, 6}});
for (const auto &innerVec : vec) {
for (const auto &p : innerVec) {
cout << "(" << p.first << ", " << p.second << ") ";
}
cout << endl;
}
return 0;
}