Cod sursa(job #920477)

Utilizator TzenyTenescu Andrei Tzeny Data 20 martie 2013 15:26:05
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.5 kb
#include <fstream>

using namespace std;

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

int cuv,nrlit,temp;
char tempy;

int main()
{
    //fout << (int)' ';
    while(fin.get(tempy))
    {
        int baty = (int)tempy;
        if((baty>=97&&baty<=122)||(baty>=65&&baty<=90))
        {
            nrlit++;
            if(temp==0)
                cuv++;
            temp=1;
        }
        else
            temp=0;
    }

    fout << (int)nrlit/cuv;

    return 0;
}