題目描述:
輸入字符串s和字符c,要求去掉s中所有的c字符,並輸出結果。
輸入:
測試數據有多組,每組輸入字符串s和字符c。
輸出:
對於每組輸入,輸出去除c字符後的結果。
樣例輸入:
#include<stdio.h>
int main()
{
char c[1000],ch;
while((scanf("%s %c",c,&ch))!=EOF)
{
for(int i=0;c[i]!='\0';i++)
{
if(c[i]!=ch)
printf("%c",c[i]);
}
printf("\n");
}
return 0;
}
heallo
a
樣例輸出:
hello