Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "func_c.h"
- using std::cin;
- using std::cout;
- using std::endl;
- int main() {
- int n, q, x, k; cin >> n;
- char cmd;
- MyVector vec;
- read(vec, n);
- cin >> q;
- while (q--) {
- cin >> cmd;
- if (cmd == '+') {
- cin >> k >> x;
- if (k--) insert(vec, x, k);
- else push_back(vec, x);
- } else if (cmd == '-') {
- cin >> k;
- if (k--) erase(vec, k);
- else pop_back(vec);
- } else if (cmd == '?') {
- print_size(vec);
- cout << '\n';
- }
- }
- print(vec);
- del(vec);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement