用c语言编写一个程序,接受用户输入字符串;编写一个函数,讲用户的指定字符删除,再输出字符串。

用c语言编写一个程序,接受用户输入字符串;编写一个函数,讲用户的指定字符删除,再输出字符串。 很急的啊 谢谢

# include <stdio.h>
# define N 20
int main(void)
{
char ch[N], find;
int i;
printf("请输入字符串:");
scanf("%s", ch);
printf("请输入你要查找的字符:");
scanf("%c", &find);
for(i=0; i<N; i++)
{
if (ch[i] != find)
putchar(ch[i]);
}

return 0;
}
温馨提示:答案为网友推荐,仅供参考
相似回答