Cod sursa(job #234703)

Utilizator RobybrasovRobert Hangu Robybrasov Data 21 decembrie 2008 19:55:24
Problema Text Scor 70
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.5 kb
#include <cstdio>
#include <cstring>

int n,i,l,cuv,len;
char ch;

int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    cuv=0;
    while (!feof(stdin))
    {
        scanf("%c",&ch);
        if (ch>=97 && ch<=122 || ch>=65 && ch<=90) cuv++;
        while (ch>=97 && ch<=122 || ch>=65 && ch<=90)
        {
            l++;
            scanf("%c",&ch);
        }
    }

    if (cuv) printf("%d",l/cuv);
    else     printf("%d",l);

    return 0;
}