Cod sursa(job #671839)

Utilizator LauuSticlet Laurentiu Andrei Lauu Data 31 ianuarie 2012 22:17:37
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.33 kb
#include<iostream>
#include<fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
	char x[1000],*p,sep[]=" !?,.;:\/0123456789'";
	int cuv=0,lit=0;
	f.get(x,1000);
	f.get();
	p=strtok(x,sep);
	while(p)
	{
		lit=lit+strlen(p);
		cuv++;
		p=strtok(NULL,sep);
	}
	g<<lit/cuv;
	return 0;
}