Cod sursa(job #526291)

Utilizator RampageSergiu Caraian Rampage Data 27 ianuarie 2011 22:46:34
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include <fstream>
using namespace std;

int main ()
	{
	char c;
	int t=0,v=0,tf=0;
	ifstream f ("Text.in");
	ofstream g ("Text.out");
	while (!f.eof())
		{
		f.get(c);
		if ((c<='z' && c>='a') || (c>='A' && c<='Z')) t++;
		else 
			{
			if (t>0) v++;
			tf+=t;
			t=0;
			}
		}

	if (tf==0 || v==0)
		g<<0;
	else
		g<<tf/v;
	g.close();
	return 0;
	}