Cod sursa(job #2055539)

Utilizator IcsyHarnagea Sabin-Sebastian Icsy Data 3 noiembrie 2017 13:21:19
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.47 kb
#include <fstream>
using namespace std;

ifstream in("text.in");
ofstream out("text.out");

int main()
{
	char x;
	int litere = 0;
	int cuvinte = 0;
	bool cuavntNou = false;

	while(in.get(x))
	{
		if(((x<='z') && (x>='a'))||((x<='Z') && (x>='A')))
		{
			litere++;
			if(cuavntNou==false)
			{
				cuavntNou=true;
				cuvinte++;
			}
		}
		else
		{
			cuavntNou=false;
		}
	}
	out<<litere/cuvinte<<"\n";

	in.close();
	out.close();
	
	return 0;
}