#include<stdio.h> #include<math.h> void main() { int i,j,temp=0; char s[100]; gets(s); for(i=0;i<strlen(s);i++) { if(s[i]<='z'&&s[i]>='a'&&s[i+1]==' ') temp++; } if(s[strlen(s)-1]<='z'&&s[strlen(s)-1]>='a') temp++; printf("%d\n",temp); } |
Double click to view unformatted code.