Cod sursa(job #1892314)

Utilizator EuAlexOtaku Hikikomori EuAlex Data 24 februarie 2017 21:18:18
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.54 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;
}