Cod sursa(job #2641896)

Utilizator AlexToveAlexandru Toader AlexTove Data 13 august 2020 00:14:18
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.52 kb
#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);

    cin.tie(0);
    cout.tie(0);

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

    int nr_cuv = 0, nr_lit = 0;
    while(!fin.eof()) {
        char c = fin.get();

        if(isalpha(c)) {
            nr_cuv++;
            while(!fin.eof() && isalpha(c)) {
                c = fin.get();
                nr_lit++;
            }
        }
    }

    fout<< nr_lit / nr_cuv;
    return 0;
}