Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using std::cin;
- using std::cout;
- #include "func.h"
- int main() {
- cin.tie(nullptr); // some magic
- std::ios::sync_with_stdio(false);
- size_t n, q, k; cin >> n;
- MyString str;
- read(str,n);
- cin >> q;
- char cmd;
- while(q--) {
- cin >> cmd;
- if (cmd == '?') print_size(str);
- else {
- cin >> k;
- if (k--) erase(str, k);
- else cout << pop_back(str) << '\n';
- }
- }
- print(str);
- del(str);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement