#include这道题目有为要注意一个细节。如果没有ch1=getchar()语句接受换行符,scanf("%c",&ch)执行后ch的值就是换行符。#include #define N 1000int main(){ char str[N],ch,ch1; char *p; int i,j; while(scanf("%s",str)!=EOF) { i=0;j=0; p=str; ch1=getchar(); scanf("%c",&ch); while(str[i]!='\0') { if(str[i]!=ch) p[j++]=str[i]; i++; } while(j