#include <stdio.h>
int main(){
char string[32];
int i,num=0,word=0;
char c;
printf("请输入一句英文:");
gets(string);
for(i=0;(c=string[i])!='\0';i++)
if(c==' ')
word=0;
else if(word==0){
word=1;
num++;
}
printf("有%d个单词",num);
return 0;
}
11-28
1424
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)