Advertisement
Ilya_konstantinov

Untitled

Dec 27th, 2023
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using std::cin;
  4. using std::cout;
  5.  
  6. #include "func.h"
  7.  
  8. int main() {
  9.   cin.tie(nullptr);
  10.   std::ios::sync_with_stdio(false);
  11.   int n, op_col, ind; cin >> n;
  12.   MyString str;
  13.   read(str, n);
  14.   cin >> op_col;
  15.   char cmd, x;
  16.   while(op_col--) {
  17.     cin >> cmd;
  18.     if (cmd == '+') {
  19.       cin >> ind;
  20.       cin.get(); x = cin.get();
  21.       if (ind--) insert(str, x, ind);
  22.       else push_back(str, x);
  23.     } else {
  24.       print_size(str);
  25.     }
  26.   }
  27.   print(str);
  28.   del(str);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement