Cod sursa(job #949056)

Utilizator RobertmwPamfile Robert Robertmw Data 12 mai 2013 13:22:56
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.4 kb
#include <iostream>
#include <fstream>
using namespace std;

ifstream f("text.in");
ofstream g("text.out");
int main()
{
	int cuv,lg=0;
	char s;
	bool ok = false;
	while (f.get(s))
	{
		while ((s >= 'a' && s <= 'z') || (s >= 'A' && s <= 'Z'))
		{
			lg++;
			ok = true;
			f.get(s);
		}
		if (ok == true)
		{
			cuv++;
			ok = false;
		}
	}
	g<< lg/cuv;
	f.close();
	g.close();
}