Cod sursa(job #2368115)

Utilizator filicriFilip Crisan filicri Data 5 martie 2019 13:53:23
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.45 kb
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");

int n,tl,w;
char c;
bool ok;

int main()
{
    while (f.get(c))
    {
        if ((c>='a' && c<='z') || (c>='A' && c<='Z'))
        {
            tl++;
            ok=1;
        }
        else if (ok==1)
        {
            w++;
            ok=0;
        }
    }
    if (ok==1) w++;
    g<<tl/w;
    f.close();
    g.close();
    return 0;
}