C-study/05-1/4/4.c

27 lines
384 B
C
Raw Normal View History

2021-11-19 11:20:55 +00:00
#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;
}