那里有错,实在找不出来
用来统计单词个数#include <stdio.h>
int mian (void)
{
char string[81];
int i,num = 0, word = 0;
char c;
gets(string);
for (i = 0;(c = string[i]) !='\0';i++)
if (c ==' ') word = 0;
else if (word == 0)
{
word = 1;
num++;
}
printf ("%d\n",num);
getchar ();
}