Cod sursa(job #2450798)

Utilizator ProBatmanBalint Leonard ProBatman Data 24 august 2019 16:44:33
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.52 kb
#include <bits/stdc++.h>

using namespace std;

ifstream fin("text.in");
ofstream fout("text.out");

long long lc = 0, nc = 0 , k = 0;
char c;
bool ok = 0;

void citire()
{
    while(fin.get(c))
    {
        if((c >='a'&&c<= 'z')||(c >='A'&&c<= 'Z'))
        {
            if(ok==0)
                nc++;
            lc++;
            ok = 1;
        }
        else
            ok = 0;
    }
}

void afisare()
{
    fout << lc/nc;
}

int main()
{
    citire();
    afisare();
    return 0;
}