Cod sursa(job #1585229)

Utilizator roxana12popescu roxana roxana12 Data 30 ianuarie 2016 21:14:31
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.41 kb


#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int s,z,nr,a,ok;
char c;
int main()
{   s=0;

    while (f.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) g<<nr/z<<'\n';
    else g<<0;
    return 0;
}