1条回答 默认 最新
- kernel312 2016-11-19 08:21关注
#include
#include
#define SIZE 30void main(){
char str1 [SIZE];
char str2 [SIZE];
char *p;
int len2;
printf("Input first string:");
scanf("%s",str1);
printf("Input deleted string:");
scanf("%s",str2);
len2 = strlen(str2);
while(p = strstr(str1,str2)){
strcpy(p,p+len2);
}
printf("result string:%s\n",str1);
}本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报