#include <stdio.h>
#define WORD 1
#define NON_WORD 0
int main(void)
{
int ch;
int word;
int state;
state=NON_WORD;
word=0;
while((ch=getchar())!=EOF)
{
if(ch==' '||ch=='\n'||ch=='\t')
{
state=NON_WORD;
}
else if(state=NON_WORD)
{
state=WORD;
++word;
}
}
printf("单词数%d\n",word);
return 0;
}
为什么运行结果为0啊,请问哪里错了I