新手求助大佬,为毛过不了。。
查看原帖
新手求助大佬,为毛过不了。。
337766
ZPR是FW楼主2020/8/15 21:42
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,x;
	char s[100*100],str[100];
	scanf("%d%s",&n,s);
	while(n--){
	scanf("%d",&x);
	if(x==1){
scanf("%s",str);
strcat(s,str);
puts(s);
}
else if(x==2){
int a,b,i;
scanf("%d%d",&a,&b)
for(i=a;i<a+b;i++)
s[i-a]=s[i];
s[b]='\0';
puts(s);
}
else if(x==3){
int a,i,lenste,lens;
scanf("%d%s",&a,str);
strcat(str,&s[a]);
s[a]='\0';
strcat(s,str);
puts(s);
}
else if(x==4){
scanf("%s",str);
char* pos=strstr(s,str);
if(pos==NULL)printf("-1\n");
else printf("%d\n",pos-s);
}
}
}
2020/8/15 21:42
加载中...