Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
37458 | xieguangkun | 【入门】文字处理软件 | C++ | 通过 | 0 MS | 240 KB | 496 | 2024-03-17 16:50:57 |
#include <iostream> using namespace std; int main(){ int q; string s3,s; cin >>q>>s3; s =s3; int t,a,b; string st; while(q--){ cin>>t; if(t==1){ cin >>st; s=s+st; cout <<s<<endl; } if(t==2){ cin >>a>>b; string temp = s.substr(a,b); s =temp; cout <<s<<endl; } if(t==3){ cin >>a>>st; s.insert(a,st); cout <<s<<endl; } if(t==4){ cin >>st; int a = s.find(st); cout <<a<<endl; } } }