1 #include <stdio.h>
2
3 #define IN 1
4 #define OUT 0
5
6 void main()
7 {
8 int nw,state;
9 char c;
10
11 nw = 0;
12 state = OUT;
13
14 while((c = getchar()) != EOF)
15 {
16 if( (c == ' ') || (c == '\t') || (c == '\n'))
17 state = OUT;
18 else if(state == OUT){
19 state = IN;
20 ++nw;
21 }
22 }
23 printf("%d\n",nw);
24 }