Cod sursa(job #2416101)

Utilizator Carol_LucaCarol Luca Carol_Luca Data 26 aprilie 2019 21:44:50
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.49 kb
/// text
#include <fstream>
#include <cctype>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
char ch;
int nrcuv,nrlit;
bool ok = false;
int main() {
    ios_base::sync_with_stdio(false);
    in.tie(0),out.tie(0);
    while(in.get(ch)) {
        if(isalpha(ch)) {
            if(!ok) {
                ok = true;
                nrcuv++;
            }
            nrlit++;
        } else
            ok = false;
    }
    out << nrlit/nrcuv;
    return 0;
}