#include #include int main ( ) { int wc; char c; for (wc=1; ; wc++) { /* We're about to encounter the wc'th word. Skip past leading white space. */ while ((c = getchar ( )) && c != EOF && isspace (c)) { } /* Read through characters of the word. */ while ((c = getchar ( )) && c != EOF && !isspace (c)) { } } printf ("%d\n", wc); return 0; }