Cod sursa(job #260979)
Utilizator | Data | 17 februarie 2009 19:56:25 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include<fstream.h>
#include<string.h>
char *p,a[2000010],b[25]=" ,.?!-_+=[]{}();:'";
int s=0,c=0;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
f.get(a,2000000);
f.get();
p=strtok(a,b);
while(p)
{
s+=strlen(p);
c++;
p=strtok(NULL,b);
}
s=s/c;
g<<s;
return 0;
}