#include <stdio.h>
#define IN 1; /*在单词内*/
#define OUT 0; /*在单词外*/
int main(int argc, char* argv[])
{
int c,n1,nw,nc,state;
state = OUT;
n1 = nw = nc = 0;
while( (c = getchar())!=EOF )
{
++n1;
if( c== '\n')
{
++n1;
}
if(c==' '||c=='\n'||c=='\t')
{
state = OUT;
}
else
{
if(state==OUT)
{
state=IN;
++nw;
}
}
}
printf("%d %d %d\n",n1,nw,nc);
return 0;
}
这段代码有什么错误啊?








没什么问题啦,我指的是你那个nc没用到,应该你是写少了计算nc的值的代码.如果你不计算nc的话,最好就别定义了,浪费内存.