题目链接:点击打开链接
题目大意:
输入字符串s和字符c,要求去掉s中所有的c字符,并输出结果。
解题思路:略。
AC代码
#include<bits/stdc++.h>
#include<cmath>
int main(){
char c;
char s[1000];
while(~scanf("%s",s)){
getchar();
scanf("%c",&c);
int le=strlen(s);
for(int i=0;i<le;i++){
if(s[i]!=c){
printf("%c",s[i]);
}
}
}
return 0;
}