#include#include #include #include #include using namespace std;void del(char *str,char *sub){ char *head = NULL; char *p = NULL; head = p = str; int sublen = strlen(sub); while(*p != '\0') { if(strncmp(p,sub,sublen) != 0) { *str = *p; str++; } else { p--; p += sublen; } p++; } *str = '\0';}int main(){ cout<<"输入一个字符串:"< >value; cout<<"输入要删除的字符串"< >sub; del(value,sub); cout<<"删除后的结果为:"< <