该代码源自"The C Programming Language,Second Edition":
#include <stdio.h>
main()
{
long nc;
nc = 0;
while(getchar() != EOF)
++nc;
printf("%s: %ld\n", "number of characters", nc);
}
Run Code Online (Sandbox Code Playgroud)
按"输入"键(EOF)后为什么不执行"printf"语句?