4444444444

#include<iostream>
using namespace std;
int main()
{
    string a;
    int l, c, i, d, e;
    while(getline(cin, a))
    {
        l = a.size();
        c = e = d = 0;
        for(i=0; i<l; i++)
        {
            if(a[i] == 32)
            {
                e = i - 1;
                while(a[e] != 32)
                {
                    if(e == 0)
                    {
                        c++;
                        break;
                    }
                    if((a[e] >=65 && a[e] <=90) || (a[e] >= 97 && a[e] <= 122))
                    {
                        d++;
                        if(d>=1)
                        {
                            c++;
                            d = 0;
                            break;
                        }
                    }
                    e--;
                }
            }
            if(i == l-1)
            {
                e = i;
                while(a[e] != 32)
                {
                    if((a[e] >=65 && a[e] <=90) || (a[e] >= 97 && a[e] <= 122))
                    {
                        d++;
                        if(d>=1)
                        {
                            c++;
                            d = 0;
                            break;
                        }
                    }
                    e--;
                }
            }
        }
        cout << c << endl;
    }
    return 0;
}
Alone three stuff use law walls fat asked. Near do that     walls walls walls------he help.

Comments