Cod sursa(job #1303820)

Utilizator stanamd123Stana Marius Vlad stanamd123 Data 28 decembrie 2014 14:16:27
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 kb
#include <iostream>
#include <fstream>

using namespace std;

ifstream fin("text.in");
ofstream fout("text.out");

int nrLit=0,nrCuv=0,ok=0;
char c;

int main()
{
    while(!(fin.eof()))
    {
        fin.get(c);
        if((c>='a' && c<='z') || (c>='A' && c<='Z'))
        {
            nrLit++;
            ok=1;
        }
        else if (ok==1)
        {
            nrCuv++;
            ok=0;
        }
    }

    fout<<nrLit/nrCuv;
}