Cod sursa(job #2173819)

Utilizator tangerine515Alex Anton tangerine515 Data 16 martie 2018 07:58:21
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.48 kb
#include <bits/stdc++.h>
#include <cassert>

using namespace std;

fstream f("text.in", ios::in);
fstream g("text.out", ios::out);

int main(void)
{
    uint16_t wcount = 0, wlett = 0;
    bool isword = false;
    char a;

    while(!f.eof())
    {
        f >> noskipws >> a;
        if(isalpha(a))
        {
            wlett++;
            if(!isword) { isword = true; wcount++; }
        }
        else isword = false;
    }
    assert(g << wlett / wcount);

    return EXIT_SUCCESS;
}