Cod sursa(job #947744)

Utilizator Sorin96Sorin Subulescu Sorin96 Data 8 mai 2013 12:37:32
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.27 kb
using namespace std;
#include<fstream>
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
	int i=0,s=0;
	char x[200],sep[]=" .;!?,-";
	char *p;
	fin.get(x,200);
	p=strtok(x,sep);
	while(p)
	{
		i++;
		s=s+strlen(p);
		p=strtok(NULL,sep);
	}
	fout<<s/i;
}