Cod sursa(job #486265)

Utilizator joli94Apostol Adrian Alexandru joli94 Data 20 septembrie 2010 22:00:15
Problema Text Scor 70
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.51 kb
#include<cstdio>

int verif(char a)
{
	if ((a>='a' && a<='z')||(a>='A' && a<='Z')) return 1;
	return 0;
}

int main()
{
	freopen ( "text.in" , "r" , stdin );
	freopen ( "text.out" , "w" , stdout );
	
	char x;
	int nr_lit = 0 , nr_cuv = 0 , s;
	bool ok = false;
	
	while (scanf("%c" , &x)!=EOF)
	{
		ok = false;
		if (verif(x)) ok= true;
		if (ok)
		{
			++nr_lit;
			if (s==0)
			{
				++nr_cuv;
				s = 1;
			}
		}
		else s = 0;
	}
	
	printf("%d\n" , nr_lit/nr_cuv);
	
	return 0;
}