Cod sursa(job #792819)

Utilizator reksaGheorghe Tudor reksa Data 30 septembrie 2012 17:00:55
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include <iostream>
#include <fstream>
using namespace std;
int cuv=0,lit=0;
char c;
bool ok=false;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
    while(!fin.eof())
    {
        c=fin.get();
        if((c>='a' && c<='z') || (c>='A' && c<='Z'))
        {lit++;ok=true;}
        else if(ok)
        {cuv++;ok=false;}
    }
    if(ok)
    {cuv++;}
    fout<<lit/cuv;
    return 0;
}