单词数怎么判断
#include <stdio.h>#include <stdlib.h>
#define in 1
#define out 0
int main()
{
int c,nl,nw,nc,state;
state = out;
nl=nw=nc=0l;
while((c=getchar())!=EOF)
{
++nc;
if(c=='\n')
++nl;
if ( c==' '|| c=='\n'|| c=='\t')
state =out;
else if (state=out){
state = in;
++nw;
}
}
printf("%d %d %d\n",nl,nw,nc);
}
这程序的单词数量怎么判断的,我不管怎么输入单词,单词的个数都是0