刚接触C,这是什么问题??求大神帮忙看看
#include"stdio.h"#include"string.h"
int wordcount(char s[])
{
int i,n=0;
for(i=0;;i++)
{
if(s[i]==' ')
n++;
if(s[i]=='\0')
{
n++;
break;
}
}
return n;
}
void main()
{
int n;
char s[100];
printf("Please input the sentence:\n");
gets(s);
wordcount(s);
printf("单词的个数是:%d个",n);
}