Cod sursa(job #686734)

Utilizator michael9ufoStanescu Mihai michael9ufo Data 21 februarie 2012 20:03:54
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.54 kb
#include <iostream>
#include <cstring>
#include <fstream>

using namespace std;

int main()
{

	freopen("text.in", "r", stdin);

	freopen("text.out", "w", stdout);
	
	char c;

	long lit = 0, cuv = 0;

	bool ic = 0;

	while(!feof(stdin))
	{
		c = fgetc(stdin);
		
		if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
		{
			if(!ic)
			{
				ic = 1;
                                ++cuv;
			}
			++lit;
		 }
		 else
			ic = 0;

	}

	fclose(stdin);
	
	cout<<lit/cuv<<"\n";

	fclose(stdout);

	return 0;

}