Cod sursa(job #2221119)

Utilizator bostanmateiBostan Matei-Calin bostanmatei Data 13 iulie 2018 10:47:18
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.45 kb
#include <fstream>

using namespace std;
char c;
int nrcuv, lgtot;
bool ok = false;
int main()
{
    freopen("text.in", "r", stdin);
    freopen("text.out", "w", stdout);
    while(scanf("%c", &c) == 1)
    {
        if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
            lgtot++, ok  = true;
        else
            if(ok == true)
                nrcuv++, ok = false;
    }
    printf("%d", lgtot / nrcuv);
    return 0;
}