You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
450 B

#include <bits/stdc++.h>
using namespace std;
vector<int> v(0);
int x;
int main() {
vector<int>::iterator iter;
v.insert(v.begin(), 1);
v.insert(v.begin(), 2);
v.insert(v.begin(), 3);
v.insert(v.begin(), 4);
v.push_back(5);
for (iter = v.begin(); iter != v.end(); ++iter)
cout << *iter << " ";
cout << v.empty() << endl;
cout << v.size()<< endl;
v.clear();
v.erase(v.begin());
return 0;
}