Cod sursa(job #1586909)

Utilizator Mihai9Oniga Mihai Mihai9 Data 1 februarie 2016 18:37:36
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.34 kb
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int s,z,nr,a,ok;
char c;
int main(){
    while (fin.get(c)) {
        if(c>='A'&&c<='Z'||c>='a'&&c<='z'){nr++;ok=1;}
        else if (ok!=0){z++;ok=0;}
    }
    if (ok!=0){z++;}
    if (z!=0){fout<<nr/z;}
    else {fout<<"0";}
    return 0;
}