[求助]统计句子中的单词数~
#include <stdio.h>void main()
{ int i=0,num=0;
char str[100],c;
gets(str);
do
{ while((c=str[i])=='')i++;
if(c!='\0')num++;
while((c=str[i])!=''&&c!='\0')i++;
} while(c!='\0');
printf("number of word:%d\n",num);
}
麻烦高手看看哪错了,运行后不对~