Cod sursa(job #41907)

Utilizator rokadaIacob Andrei Vasile rokada Data 28 martie 2007 18:08:31
Problema Text Scor 50
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 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[]=" ,./;'[]-=>?:<{}_+|[email protected]#$%^&*()";
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;
}