Cod sursa(job #1067207)

Utilizator L.DanielLungu Daniel L.Daniel Data 26 decembrie 2013 15:44:38
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <fstream>
using namespace std;
int main()
{
	fstream f("text.in", ios::in);
	fstream g("text.out", ios::out);
	char c;
	int litere = 0, cuvinte = 0, ok;
	while (!f.eof())
	{
		f.get(c);
		ok = 0;
		while (c >= 'a'&&c <= 'z' || c >= 'A'&&c <= 'Z')
		{
			ok = 1;
			litere++;
			f.get(c);


		}
		if (ok == 1)	cuvinte++;
	}
	g << litere / cuvinte;
	return 0;
}