Cod sursa(job #1915431)

Utilizator razvan171514Razvan Mihai razvan171514 Data 8 martie 2017 21:00:08
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.58 kb
#include <cstdio>

using namespace std;

int main()
{
    freopen("text.in", "r", stdin);
    freopen("text.out", "w", stdout);
    char c;
    int LT = 0, NC = 0;
    bool inceput = 0;
    while(scanf("%c", &c) != EOF)
    {
        if(('a' <= c && c <= 'z')||('A' <= c && c <= 'Z'))
        {
            ++ LT;
            inceput = 1;
        }
        else
        {
            if(inceput)
            {
                inceput = 0;
                ++ NC;
            }
        }
    }
    if(inceput)
        ++ NC;
    printf("%d", LT/NC);
    return 0;
}