Cod sursa(job #920406)

Utilizator TzenyTenescu Andrei Tzeny Data 20 martie 2013 12:31:54
Problema Text Scor 60
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.56 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++;
            temp++;
        }
        if(baty==32)
        {
            if(temp>0)
                cuv++;
            temp=0;
        }
    }
    if(temp>0)
        cuv++;

    fout << (int)nrlit/cuv;

    return 0;
}