Cod sursa(job #940952)

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

    /*for(int i=1;i<=2060;i++)
        g<<char(i)<<"\n";*/
    return 0;
}