Cod sursa(job #128508)
Utilizator | Data | 27 ianuarie 2008 12:56:22 | |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include<fstream.h>
#include<string.h>
int main(){
char a[65535],*p,sep[]="~!@#$%^&*()_+=-`1234567890][{}\';:,./?><|""";
int s=0,i,y=0;
ifstream f("text.in");
ofstream g("text.out");
while(!f.eof())
{f>>a;
p=strtok(a,sep);
while(p)
{ y++;
s+=strlen(p);
p=strtok(NULL,sep);
}
}
g<<(int)s/y;
return 0;
}