Cod sursa(job #2559657)

Utilizator SzasziHUNZoltani Szabolcs SzasziHUN Data 27 februarie 2020 14:48:54
Problema Text Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.47 kb
#include <iostream>
#include <fstream>

using namespace std;

int main()
{
    ifstream f("text.in.txt");
    ofstream g("text.out.txt");
    char a;
    int betu=0,sz=0;
    bool b=false;
    while (f.get(a)){
        if ((a>='a' && a<='z') ||  (a>='A' && a<='Z')){
            b=true;
            betu++;
        }
        else {
            if (b==true){ sz++;b=false;}
        }
    }
    g<<(betu/sz);
    f.close();
    g.close();
    return 0;
}