Cod sursa(job #1903805)

Utilizator arcadie2k@gmail.comArcadie Caldare [email protected] Data 5 martie 2017 12:54:22
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.4 kb
#include<fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main(){
    char ch;
    int cuv=0, lit=0, k;
    bool ok=false;
    while(fin.get(ch)){
        if(isalpha(ch)){
            lit++;
            ok=true;
        }
        else if(ok && !isalpha(ch)){
            cuv++;
            ok=false;
        }
    }
    fout<<lit/cuv;
    return 0;
}