填空题
下列给定程序中函数fun的功能是:删除s所指字符中所有的小写字母c。
请改正程序中的错误,使它能得出正确的结果。
注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。
试题程序:
#include<stdio.h>
void fun(char*s)
{
int i, j;
for(i=j=0; s[i]!="/0"; i++)
if(s[i]!="c")
/**********found**********/
s[j]=s[i];
/**********found**********/
s[i]="/0";
}
void main()
{
char s[80];
printf("/nEnter a string:");
gets(s);
printf("The original string:");
puts(s);
fun(s);
printf("The string after deleted:");
puts(s);
printf("/n/n");
}