Cod sursa(job #2562901)

Utilizator NeganAlex Mihalcea Negan Data 29 februarie 2020 19:52:09
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.47 kb
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");


char c;
int main()
{
    int i;
    bool ok = 1;
    int ltot = 0, nrcuv = 0;
    while(fin.get(c))
    {
        if(isalpha(c))
        {
            if(ok == 1)
            {
                nrcuv++;
                ok = 0;
            }
            ltot++;
        }
        else
            ok = 1;
    }
    fout << ltot / nrcuv;
    return 0;
}