#include<stdio.h> int main() { char str[100],c; int j,k; printf("please input a string:"); gets(str); printf("\nEnter a character:"); c=getchar(); for(j=k=0;str[j]!='\0';j++) if(str[j]!=c) str[k++]=str[j]; str[k]='\0'; printf("\n%s",str); }
<pre name="code" class="cpp">please input a string:wqeqwe Enter a character:w qeqePress any key to continue
版权声明:本文为博主原创文章,未经博主允许不得转载。
原文:http://blog.csdn.net/u012701023/article/details/46820887