#include
#include
void main()
{char line[80] ;
char ch;
int i,j;
int len;
printf("输入一行字符 \n");
//___________________ ;
gets(line);
printf("输入要删除字符 ");
ch=getchar();
i=0;
while(line[i]!='\0' )
{// while(__________________&& line[i]!=ch) i++;
while(line[i]!='\0'&& line[i]!=ch) i++;
len=strlen(line);
for(j=i;j
line[j]=line[j+1];
line[j]='\0';
}
puts(line);
}
//写好了,对不起,没看到楼上已经回答了
#include
#include
void main()
{char line[80] ;
char ch;
int i,j;
int len;
printf("输入一行字符 \n");
//___________________ ;
gets(line);
printf("输入要删除字符\n ");
ch=getchar();
i=0;
while(line[i]!='\0' )
{
while(line[i]!='\0'&& line[i]!=ch) i++;//
len=strlen(line);
for(j=i;j
line[j]='\0';
}
puts(line);
}