#include<stdio.h>
int main(){
char ch;
int word = 0;
int count = 0;
while((ch=getchar())!='\n'){
if(ch == ' ')
word = 0;
else if(0 == word){
count++;
word = 1;
}
}
printf("the numbers of words is: %d", count);
return 0;
}
评论