Cod sursa(job #354512)
| Utilizator | Data | 8 octombrie 2009 16:43:08 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.39 kb |
#include<fstream.h>
fstream in,out;
long i;
char v[10500];//00
long c=0,l=0,t=0;
int main()
{in.open("text.in",ios::in);
out.open("text.out",ios::out);
in.getline(v,1050000,EOF);
i=0;
while(v[i]!=0)
{t=0;
while(((v[i]>=65&&v[i]<=90)||(v[i]>=97&&v[i]<=122))&&v[i]!=0)
{t++;
i++;}
if(t>0)
{l=l+t;
c++;}
else
i++;}
if(c>0)
out<<(l/c);
else
out<<"0";
return 0;}
