Cod sursa(job #1313275)

Utilizator tudorcomanTudor Coman tudorcoman Data 10 ianuarie 2015 15:05:56
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 kb
#include<cstdio>

using namespace std;

int l,cuv;
char c;
bool ok = false;

int main()
{
    freopen ("text.in","r",stdin);
    freopen ("text.out","w",stdout);
    while(scanf("%c",&c)!=-1)
    {
        if((c>='a' && c<='z')||(c>='A' &&c<='Z'))
        {
            ++l;
            ok = true;
        }
        else if( ok )
        {
            ++cuv;
            ok = false;
        }
    }

    printf("%d\n",l/cuv);

    return 0;
}