Cod sursa(job #2616135)

Utilizator mihnea03Ciocioiu Mihnea mihnea03 Data 16 mai 2020 19:58:02
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.54 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;
}