Cod sursa(job #645606)

Utilizator LauuSticlet Laurentiu Andrei Lauu Data 9 decembrie 2011 23:11:27
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include<iostream>
#include<string.h>
#include<fstream>
using namespace std;
int main()
{
	ifstream f("text.in");
	ofstream g("text.out");
	int nr=0,n=0;
	char s[1000],*p,sep[]=" ";
	f.get(s,1000);
	f.get();
	p=strtok(s," ,.-;:!?01234\"\'56789");
	while(p)
	{
		n++;
		nr=nr+strlen(p);
		p=strtok(NULL," ,.-;:!?01234\"\'56789");
	}
	g<<nr/n;
	return 0;
}