Cod sursa(job #526280)

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

int main ()
	{
	string s;
	bool cuvant=false;
	int t=0,v=0,tf=0;
	ifstream f ("Text.in");
	ofstream g ("Text.out");
	

	for (int i=0; !f.eof() ; i++)
		{
		s+=f.get();
		if ((s[i]<=90 && s[i]>=65) || (s[i]>=97 && s[i]<=122))
			{
			cuvant=true;
			t++;
			}
		else 
			{
			cuvant=false;
			if (t>0) v++;
			tf+=t;
			t=0;
			}
		}

	g<<tf/v;
	g.close();
	return 0;
	}