Cod sursa(job #97956)

Utilizator recviemAlexandru Pana recviem Data 9 noiembrie 2007 17:21:38
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.5 kb
#include <stdio.h>

void do_it()
{
    bool k=0;
    char c;
    long len=0,cuv=0;
    freopen("text.in","r",stdin);
    while (!feof(stdin))
    {
        scanf("%c",&c);
        if (('a'<=c && c<='z') || ('A'<=c && c<='Z'))
        {
            len++;
            if (!k) cuv++;
            k=1;
        }
        else k=0;
    }
    fclose(stdin);
    freopen("text.out","w",stdout);
    printf("%ld",len/cuv);
    fclose(stdout);
}

int main()
{
    do_it();
    return 0;
}