Cod sursa(job #1810699)

Utilizator 41xofSav Cristian-Theodor 41xof Data 20 noiembrie 2016 14:34:41
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.41 kb
#include<string>
#include<fstream>

using namespace std;

int main(){
    char x;
    int contl=0,contc=0;
    int ok;
    ifstream f("text.in");
    ofstream g("text.out");
    while(f.get(x)){
        if((x>='a'&&x<='z')||(x>='A'&&x<='Z')){
            contl++;
            ok=1;
        }
        else {
            if(ok==1) contc++;
            ok=0;
        }
    }
    g<<contl/contc;
}