Cod sursa(job #11549)

Utilizator skyelHighScore skyel Data 31 ianuarie 2007 20:56:29
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.45 kb
#include<fstream.h>
#include<string.h>
#define input "text.in"
#define output "text.out"


int main()
	{
	ifstream fin(input);
	char a[100000];
	char *b,*c;
	int s,n;
	s=0;
	b=" \|?/>.<,':;}]{[+= _-)(*&^%$#@!~`0123456789";
   b[0]='"';
	while( !fin.eof() )
		{
		fin.getline(a,100000);
		c=strtok(a,b);
		while(c)
			{
			s++;
			n=n+strlen(c);
			c=strtok(NULL,b);
			}
      }
	ofstream fout(output);
	fout<<n/s;
	return 0;
	}