Cod sursa(job #940959)

Utilizator cypy2474alupei ciprian cypy2474 Data 17 aprilie 2013 16:48:16
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.47 kb
#include<fstream>
#include<cstdio>
using namespace std;
char x;
int cuv,med,nr,l;
int main()
{
    ifstream f("text.in");
    ofstream g("text.out");
    while (!f.eof())
    {
        f.get(x);
        if((x>='a'&&x<='z')||(x>='A'&&x<='Z'))
        {
            nr++;
            l++;
        }
        if(!((x>='a'&&x<='z')||(x>='A'&&x<='Z'))&&nr>0)
        {
            nr=0;
            cuv++;
        }
    }
    med=l/cuv;
    g<<med;
    return 0;
}