北邮OJ 140 字符串操作
#include <bits/stdc++.h>
using namespace std;
int main(){
string c;
while(cin>>c){
int t;
scanf("%d",&t);
while(t--){
int i,len,x;
char temp;
scanf("%d",&x);
if(x==0){
scanf("%d %d",&i,&len);
for(int j=i,m=i+len-1;j<m;j++,m--){
temp=c[j];
c[j]=c[m];
c[m]=temp;
}
cout<<c<<endl;
}
if(x==1){
scanf("%d %d",&i,&len);
string a;
cin>>a;
c.replace(i,len,a);
cout<<c<<endl;
}
}
}
}