Cod sursa(job #2166)

Utilizator rokadaIacob Andrei Vasile rokada Data 16 decembrie 2006 09:57:49
Problema Text Scor 50
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include<fstream.h>
#include<math.h>
int nrc,nrl;
char s[1000000],*p,sep[]=" ,./;'\[]-<>?:";
int main()
{
	ifstream f("text.in");
   ofstream g("text.out");
   while(!f.eof())
   {
   	f.getline(s,1000000);
   	p=strtok(s,sep);
   		while(p)
   		{
   			nrl+=strlen(p);
   			nrc++;
   			p=strtok(NULL,sep);
   		}
   }
   g<<floor(nrl/nrc);
return 0;
}