1#include <iostream>
2#include <utility>
3#include <vector>
4
5using namespace std;
6
7
8int main()
9{
10 vector< pair<int, int> > v;
11 int N = 5;
12 const int threshold = 2;
13 for(int i = 0; i < N; ++i)
14 v.push_back(make_pair(i, i));
15
16 int i = 0;
17 while(i < v.size())
18 if (v[i].second > threshold)
19 v.erase(v.begin() + i);
20 else
21 i++;
22
23 for(int i = 0; i < v.size(); ++i)
24 cout << "(" << v[i].first << ", " << v[i].second << ")\n";
25
26 cout << "Done" << endl;
27}