二级C语言试题
编程试题
#include <stdio.h>
void fun (char *s,char c)
{
int i,j,n;
for i=0;s[i]= ;i++)
if(s[i]==c)
{
n= ;
while (s[i+1+n] =’\0’)n++;
for (j=i+n+1;j>i;j–)
s[j+1]= ;
i=i+1;
}
}
main( )
{
char s[80]=“baacda”,c;
printf("\nThe string:%s\n",s);
printf("\nInput a character: “);
scanf(”%c",&c);
fun(s,c);
printf("\nThe result is:%s\n",s);
}