Cod sursa(job #1597955)

Utilizator RaresEGaySopterean Adrian RaresEGay Data 12 februarie 2016 15:11:52
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include<fstream>
#include<iostream>
#include<string.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int Cuv, Lit;
char s;
bool ok;
int main(){
    while(!fin.eof()){
        fin.get(s);
        if(s>='A' and s<='Z' or s>='a' and s<='z'){
                ++Lit;
                ok = true;
        }
        else if(ok){
            ++Cuv;
            ok = false;
        }
    }
    fout<<Lit/Cuv;
}