Cod sursa(job #295010)
| Utilizator | Data | 2 aprilie 2009 22:00:51 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | infoexpert | Marime | 0.41 kb |
#include<string.h>
#include<fstream.h>
ifstream f("text.in");
ofstream g("text.out");
char c,lit[100]= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
long l,lmax,nr;
int main()
{
f.get(c);
l=0;
while(!f.eof())
{
if(!strchr(lit,c)&&l!=0)
{
lmax=lmax+l;
l=0;
nr++;
}
else
if(strchr(lit,c))
l++;
f.get(c);
}
if(l)
{
nr++;
lmax=lmax+l;
}
g<<lmax/nr;
f.close();
g.close();
return 0;
}
