#include <cstdio>
#include <cstring>
int main() {
char str[300];
while (gets(str)) {
int count = 0;
int len = strlen(str);
for (int i = 0; i < len; i++) {
if ((str[i] >= 'A' && str[i] <= 'Z' || str[i] >= 'a' &&str[i] <= 'z')
&& !(str[i+1] >= 'A' && str[i+1] <= 'Z' || str[i+1] >= 'a' &&str[i+1] <= 'z'))
count++;
}
printf("%d\n", count);
}
return 0;
}
UVA 494 Kindergarten Counting Game
最新推荐文章于 2017-05-09 21:32:00 发布