Cod sursa(job #103936)
Utilizator | gaboru corupt gabor_oliviu1991 | Data | 15 noiembrie 2007 19:41:18 |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 kb |
#include<fstream.h>
#include<string.h>
int main(){
char a[65535];
unsigned int s=0,k=0,i,y=0,x;
ifstream f("text.in");
ofstream g("text.out");
while(!f.eof())
{
f>>a;
for(i=0;i<strlen(a);i++)
{
if(a[i]>47&&a[i]<58||a[i]>64&&a[i]<91||a[i]>96&&a[i]<123)
{ while(a[i]>47&&a[i]<58||a[i]>64&&a[i]<91||a[i]>96&&a[i]<123)
{k++;i++;}
y++;s+=k;
}
k=0;
}
}
x=s/y;
g<<x;
return 0;
}