#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,opt,l,r;
string s,a;
cin>>n>>s;
while(n--)
{
cin>>opt;
if(opt==1)
{
cin>>a;
s.append(a);
cout<<s<<endl;
}
else if(opt==2)
{
cin>>l>>r;
s=s.substr(l,r);
cout<<s<<endl;
}
else if(opt==3)
{
cin>>l>>a;
s.insert(l,a);
cout<<s<<endl;
}
else
{
cin>>a;
cout<<(int)s.find(a)<<endl;
}
}
return 0;
}
标签:opt,处理软件,cout,insert,int,cin,substr
From: https://blog.csdn.net/MY_253/article/details/141864014