我错在那了?(关于计算一行字符中,有多少个单词,单词用空格搁开!)
#include "stdio.h"main()
{
char str[81];
int i,num=0,word=0;
char c;
gets(str);
for(i=0;(c=str[i])!='\0';i++)
if(c=='')word=0;
else if(word==0)
{
word=1;
num++;
}
printf("there are %d word in the line\n",num);
}