Cod sursa(job #1488349)

Utilizator cyber_ghSoltan Gheorghe cyber_gh Data 18 septembrie 2015 19:41:30
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.4 kb
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int n, nrc, nr, nrcuv;
char c;
int main()
{
	while (!f.eof())
	{
		f.get(c);
		if ((c >= 65 and c <= 90) or(c >= 97 and c <= 122))
		{
			nr = 0;
			while ((c >= 65 and c <= 90) or(c >= 97 and c <= 122))
			{
				f.get(c);
				nr++;
			}
			nrc += nr; nrcuv++;
		}
	}
	g << nrc / nrcuv;
	return 0;
}