Cod sursa(job #1067196)

Utilizator L.DanielLungu Daniel L.Daniel Data 26 decembrie 2013 15:36:12
Problema Text Scor 60
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <fstream>
using namespace std;
int main()
{
	fstream f("text.in", ios::in);
	fstream g("text.out", ios::out);
	char a[1000];
	int litere = 0, cuvinte = 0, ok, i;
	f.get(a, 1000, EOF);
	i = 0;
	while (a[i]!=NULL)
	{
		ok = 0;
		while (a[i] >= 'a'&&a[i] <= 'z' || a[i] >= 'A'&&a[i] <= 'Z')
		{
			ok = 1;
			litere++;
			i++;
			
			
		}
	if(ok==1)	cuvinte++;
	i++;
	}
	g << litere / cuvinte;
	return 0;
}