UVA 494
#include<iostream> #include<string> #include<cctype> #include<cstring> using namespace std; char s[100000]; int main() { while(cin.getline(s,100000)) { int sum=0,i=0; while(i<strlen(s)) { if(isalpha(s[i])&&!isalpha(s[i+1])) { sum++; i++; } else i++; } memset(s,0,sizeof(s)); cout<<sum<<endl; } return 0; }