Cod sursa(job #2274143)

Utilizator toadehuPuscasu Razvan Stefan toadehu Data 1 noiembrie 2018 14:19:50
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.47 kb
#include <bits/stdc++.h>

using namespace std;

char ch;

int words,no;

int main()
{
    ifstream fin ("text.in");
    ofstream fout ("text.out");
    while (fin.get(ch))
    {
        if (isalpha(ch))
        {
            words++;
            while (isalpha(ch))
            {
                no++;
                fin.get(ch);
            }
        }
    }

    cout << no << '\n';
    cout << words << '\n';
    fout<<no/words<<"\n";
    return 0;
}