第1个回答 2011-07-06
#include<stdio.h>
void delchar(char *s,char c)
{
int i=0;
printf("After delected,the string is:");
while(s[i]!='\0')
{
if(s[i]!=c)
printf("%c",s[i]);
i++;
}
printf("\n");
}
void main()
{
char s[50];
char c;
printf("Input a string:");
gets(s);
printf("Input a char:");
getchar();//接受回车换行符
c=getchar();
delchar(s,c);
}