int ch; while( (ch = getchar()) != EOF ) { putchar(ch); } 执行程序,输入:we are the,然后回车.运行结果如下: [purple@localhost ]$ ./a.out we are the we are the 注意光标位置是在最后一行空白行上,以及getchar是接收空格以及\n的. 即执行程序,输入:we are the,然后回车.则程序就会去执行puchar(ch),然后输出we are the,这个地方不要忘了,系统输