| Encoders
>
More...
>
C
>
Program 
/* Program for word count. */
#include <stdio.h>
#define IN	1
#define OUT	0
main()
{
	int c,state=OUT,n=0;
	while((c=getchar())!=EOF)
		if(c==' '||c=='\t'||c=='\n')
			state=OUT;
		else if(state==OUT)
		{
			state=IN;
			n++;
		}
	printf("%d\n",n);
}
 |