Cod sursa(job #154034)

Utilizator jeanFMI - Petcu Ion Cristian jean Data 10 martie 2008 21:26:09
Problema Text Scor 70
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include<fstream.h>
#include<iomanip.h>
char c;
int cuv=0,l=0;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
while(!f.eof())
{f>>resetiosflags(ios::skipws)>>c;

if(c>=65&&c<=90||c>=97&&c<=122)
    {cuv++;
     while(c>=65&&c<=90||c>=97&&c<=122)
      {l++;
      f>>resetiosflags(ios::skipws)>>c;
       }
    }
}
g<<l/cuv;
f.close();
g.close();
return 0;
}