Cod sursa(job #260986)
Utilizator | Data | 17 februarie 2009 19:58:45 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include<fstream.h>
#include<string.h>
char *p,a[3000010],b[40]=" ,.?!-_+=[]{}();:'<>@#$%^&*()~`";
long s=0,c=0;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
f.get(a,3000000);
f.get();
p=strtok(a,b);
while(p)
{
s+=strlen(p);
c++;
p=strtok(NULL,b);
}
s=s/c;
g<<s;
return 0;
}