Cod sursa(job #1399102)

Utilizator DysKodeTurturica Razvan DysKode Data 24 martie 2015 16:09:29
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.52 kb
#include <fstream>
#include <cstring>

using namespace std;

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

long long int i,j,n,l,c,lit,cuv;
char s;

int main()
{
    while( fin.get(s) )
    {
        if( ( s >= 'a' && s <= 'z' ) || ( s >= 'A' && s <= 'Z') )
        {
            ++cuv;
            ++lit;
            while( fin.get(s) && ( s >= 'a' && s <= 'z' ) || ( s >= 'A' && s <= 'Z' ) )
            {
                ++lit;
            }
        }
    }

    fout<<lit/cuv;

return 0;
}