Cod sursa(job #1625255)

Utilizator mihai.constantinConstantin Mihai mihai.constantin Data 2 martie 2016 17:51:08
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.51 kb
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

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

    char c;

    long long nr, L, nr_cuv;

    nr = L = nr_cuv = 0;

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

            nr++;

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

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

    return 0;
}