Cod sursa(job #1919644)

Utilizator andrei20003Ionescu Andrei andrei20003 Data 9 martie 2017 20:21:48
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int nrc=0,lc=0;
    char prevc,c;
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    c=fgetc(stdin);
    while (c!=EOF) {
        if (isalpha(c)) {
            lc++;
            if (!isalpha(prevc))
                nrc++;
        }
        prevc=c;
        c=fgetc(stdin);
    }
    printf("%d", lc/nrc);
    return 0;
}