#include <stdio.h>
#define MAXN 20
void delchar( char *str, char c )
{
int j;
for(int i=0;*(str+i)!='\0';i++)
{
if(*(str+i)==c)
{
*(str+i)=*(str+i+1);
i--;
for(j=i;*(str+j+1)!='\0';j++)
{
*(str+j+1)=*(str+j+2);
}
}
}
}
int main()
{
char str[MAXN], c;
scanf("%c\n", &c);
gets(str);
delchar(str, c);
printf("%s\n", str);
return 0;
}
标签:字符,int,++,char,delchar,MAXN,str,字符串,本题 From: https://blog.csdn.net/2302_80413741/article/details/136858304