main(){ long nc; nc = 0; while (getchar() != EOF) ++nc; printf("%ld\n", nc); }
EOF indicates "end of file". A newline (which is what happens when you press enter) isn't the end of a file, it's the end of a line,
so a newline doesn't terminate this loop.