Cod sursa(job #1402719)

Utilizator TimoteiCopaciu Timotei Timotei Data 26 martie 2015 19:15:26
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include<iostream>
#include<fstream>
using namespace std;
int l,c,b='@';

bool text(char a)
{
    return ('a'<=a&&a<='z')||(a>='A'&&a<='Z');
}
int main()

{
ifstream f("text.in");
    ofstream g("text.out");
    while(!f.eof())
    {
      char  a=f.get();
       if(text(a)&&!text(b))c++;
       if(text(a))l++;
       b=a;
    }
    g<<l/c;
    return 0;
}