Cod sursa(job #2627288)

Utilizator al3xionescuIonescu Alexandru al3xionescu Data 10 iunie 2020 12:43:50
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.56 kb
#include <fstream>
#define dim 1000010
using namespace std;
char a;
long long i, ok, cuv, lit;
 
long long esteLitera(char a) {
    if (islower(a) || isupper(a)) return 1;
    return 0;
}
 
int main() {
    ifstream fin("text.in");
    ofstream fout("text.out");
    ok = 1;
    while (fin.get(a)) {
        if (esteLitera(a)) {
            lit++;
        }
        if (esteLitera(a) && ok) {
            cuv++;
            ok = 0;
        }
        if (!esteLitera(a)) {
            ok = 1;
        }
    }
    fout << lit/cuv;
    return 0;
}