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;
}

 

posted @ 2012-04-28 12:27  open your eyes  阅读(166)  评论(0编辑  收藏  举报