Cod sursa(job #1625325)

Utilizator mihai.constantinConstantin Mihai mihai.constantin Data 2 martie 2016 18:11:55
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.48 kb
#include <iostream>
#include <cstdio>
using namespace std;

int main()
{
    freopen("text.in", "r", stdin);
    freopen("text.out", "w", stdout);

    char c;

    int nr, L, nr_cuv;

    nr = L = nr_cuv = 0;

    while( scanf("%c", &c) != EOF )
    {
        if ( (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') )
        {
            if(!nr) nr_cuv++;

            nr++;

            L += 1;
        }
        else
            nr = 0;
    }

    printf("%d", L / nr_cuv);

    return 0;
}