Cod sursa(job #561388)

Utilizator nicknameLare Nicu nickname Data 20 martie 2011 01:40:20
Problema Text Scor 60
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <fstream>
#include <string.h>

using namespace std;

ifstream fin("text.in");
ofstream fout("text.out");

int main(){
	char *s,sep[]=". ,-!?:;1234567890/\\@#$%^&*()_=+{}'<`~>",*t;
	long long nrw=0, len=0;
	s=new char [1111111111];
	fin.getline(s,1111111110,EOF);
	t=strtok(s,sep);
	while (t!=NULL){
		nrw++;
		len+=strlen(t);
		t=strtok(NULL,sep);
	}
	fout<<(long long)(len/nrw);
	delete [] s;
	fin.close();
	fout.close();
	return 0;
}