Cod sursa(job #396715)

Utilizator MKLOLDragos Ristache MKLOL Data 15 februarie 2010 19:25:02
Problema Text Scor 100
Compilator cpp Status done
Runda Pregatire OJI 2010 Marime 0.47 kb
#include<stdio.h>
long long a,z,cuv;
int main()
{   freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    char v;
    int a;
    while(scanf("%c",&v)==1)
    {   if(('a'<=v&&v<='z')||('A'<=v&&v<='Z'))
        {
            ++a;
            ++z;
        }
        else if(a!=0)
        {
            ++cuv;
            a=0;
        }
    }
    if(a!=0)
    {
        a=0;
        ++cuv;
    }
    printf("%lld",z/cuv);
    return 0;
}