Cod sursa(job #2559777)

Utilizator AndreiStrAndrei Stroici AndreiStr Data 27 februarie 2020 16:38:48
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.45 kb
#include <bits/stdc++.h>

using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char ch;
int n,nrcv;

int main()
{
    bool of=false;
    while(f.get(ch))
    {
        if(isalpha(ch))
        {
            n++;
            of=true;
        }
        else
        {
            if(of==true)
            {
                of=false;
                nrcv++;
            }
        }
    }
    g<<n/nrcv;
    return 0;
}