Cod sursa(job #41892)
Utilizator | Data | 28 martie 2007 17:55:16 | |
---|---|---|---|
Problema | Text | Scor | 50 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<fstream.h>
#include<math.h>
ifstream f("text.in");
ofstream g("text.out");
long int nrc=0,nrl=0;
char s[10000000],*p,sep[]=" ,./;'[]-=>?:<{}_+|";
int main()
{
while(!f.eof())
{
f.getline(s,10000000);
p=strtok(s,sep);
while(p)
{
nrl+=strlen(p);
nrc++;
p=strtok(NULL,sep);
}
}
g<<floor(nrl/nrc);
return 0;
}