Uva Problem 494 Kindergarten Counting Game Solution

Problem Link

Uva  494 Kindergarten Counting Game Solution
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int c=0,i;
    string s;
    while(getline(cin,s))
    {
        for(i=0;i<s.size();i++)
        {
            if(isalpha(s[i]) && !isalpha(s[i+1]))
                c++;
        }
        cout<<c<<endl;
        c=0;
    }
    return 0;
}


No comments

Theme images by enjoynz. Powered by Blogger.