Language: C++

#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>

using namespace std;

int main()
{
	vector<char> str;
	char c;
	while (scanf("%c", &c) != EOF){
		str.push_back(c);
	}
	int n;
	scanf("%d", n);
	while (n--){
		char *require;
		scanf("%s", require);
		if (require == "replace"){
			int a, b;
			char* strings;
			scanf("%d %d %s", &a, &b, strings);
			copy(strings, strings + strlen(strings), str[a]);
		}
		else if (require == "reverse"){
			int a, b;
			scanf("%d %d", &a, &b);
			vector<char> rev;
			copy(str[a], str[b], rev);
			reverse(rev.begin(), rev.end());
			copy(rev[0], rev[rev.size() - 1], str[a]);
		}
		else{
			int a, b,idx;
			scanf("%d %d", &a, &b);
			for (idx = a; idx <= b; idx++){
				printf("%c", str[idx]);
			}
			printf("\n");
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:49: error: 'strlen' was not declared in this scope
   24 |                         copy(strings, strings + strlen(strings), str[a]);
      |                                                 ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<algorithm>
  +++ |+#include <cstring>
    5 | 
In file included from /usr/include/c++/14/vector:62,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of '_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = char; _OI = vector<char>]':
/usr/include/c++/14/bits/stl_algobase.h:548:42:   required from '_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = char; _OI = vector<char>]'
  548 |     { return std::__copy_move_a2<_IsMove>(__first, __last, __result); }
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:556:31:   required from '_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = char; _OI = vector<char>]'
  556 |                 std::__copy_move_a1<_IsMove>(std::__niter_base(__first),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  557 |                                              std::__niter_base(__last),
      |                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~
  558 |                                              std::__niter_base(__result)));
      |                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:651:7:   required from '_OI std::copy(_II, _II, _OI) [with _II = char; _OI = vector<char>]'
  650 |       return std::__copy_move_a<__is_move_iterator<_II>::__value>
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  651 |              (std::__miter_base(__first), std::__miter_base(__last), __result);
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:30:8:   required from here
   30 |                         copy(str[a], str[b], rev);
      |                         ~~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:514:64: error: no type named 'iterator_category' in 'struct std::iterator_traits<char>'
  514 |       typedef typename iterator_traits<_II>::iterator_category _Category;
      |                                                                ^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:521:51: error: no type named 'iterator_category' in 'struct std::iterator_traits<char>'
  520 |       return std::__copy_move<_IsMove, __memcpyable<_OI, _II>::__value,
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  521 |                               _Category>::__copy_m(__first, __last, __result);
      |                               ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of '_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = char; _OI = char]':
/usr/include/c++/14/bits/stl_algobase.h:548:42:   required from '_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = char; _OI = char]'
  548 |     { return std::__copy_move_a2<_IsMove>(__first, __last, __result); }
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:556:31:   required from '_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = char; _OI = char]'
  556 |                 std::__copy_move_a1<_IsMove>(std::__niter_base(__first),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  557 |                                              std::__niter_base(__last),
      |                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~
  558 |                                              std::__niter_base(__result)));
      |                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:651:7:   required from '_OI std::copy(_II, _II, _OI) [with _II = char; _OI = char]'
  650 |       return std::__copy_move_a<__is_move_iterator<_II>::__value>
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  651 |              (std::__miter_base(__first), std::__miter_base(__last), __result);
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:32:8:   required from here
   32 |                         copy(rev[0], rev[rev.size() - 1], str[a]);
      |                         ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:514:64: error: no type named 'iterator_category' in 'struct std::iterator_traits<char>'
  514 |       typedef typename iterator_traits<_II>::iterator_category _Category;
      |                                                                ^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:521:51: error: no type named 'iterator_category' in 'struct std::iterator_traits<char>'
  520 |       return std::__copy_move<_IsMove, __memcpyable<_OI, _II>::__value,
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  521 |                               _Category>::__copy_m(__first, __last, __result);
      |                               ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~