Cod sursa(job #733714)

Utilizator gabrielvGabriel Vanca gabrielv Data 12 aprilie 2012 20:10:44
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.41 kb
using namespace std;
#include<cstdio>
int letter,nrcuv;
int main()
{
	freopen("text.in","r",stdin);
	freopen("text.out","w",stdout);
	bool ok=0;
	char chs='0';
	while(chs!='\n')
	{
		scanf("%c",&chs);
			if((('a'<=chs)&&(chs<='z'))||(('A'<=chs)&&(chs<='Z')))
			{
				letter++;
				ok=1;
			}
			else
				if(ok)
				{
					ok=0;
					nrcuv++;
				}
	}
	printf("%d\n",letter/nrcuv);
	return 0;
}