C-study/05-1/4/4.c
2021-11-19 19:20:55 +08:00

27 lines
384 B
C

#include<stdio.h>
int main(){
int n=0,k=0;
char a;
while(scanf("%c",&a)!=EOF){
if(a=='\n'){
break;
}
if(a==' ') {
if(k==0){
k=1;
n++;
continue;
}
continue;
}
k=0;
}
if(k==1){
n--;
}
printf("%d",n+1);
return 0;
}