vector的一些操作
vector<int> v;
cout << "vector" << endl;
//增
cout << "增" << endl;
v.push_back(1);
v.push_back(2);
v.push_back(3);
v.push_back(4);
for (auto i : v) {
cout << i << " ";
}
cout << endl;
//插,需要使用迭代器
auto it = v.begin();
cout << "插" << endl;
v.insert(it+2, 100);
for (auto i : v) {
cout << i << " ";
}
cout << endl;
//删 需要使用迭代器
cout << "删" << endl;
auto it1 = v.begin();
v.erase(it1+2);
for (auto i : v) {
cout << i << " ";
}
cout << endl;
//查
cout << "查" << endl;
auto find_it= find(v.begin(), v.end(), 2);
cout << *find_it << endl;
deque的一些操作
deque<int> d;
cout << "deque" << endl;
//增
cout << "增" << endl;
d.push_back(11);
d