Cod sursa(job #237919)

Utilizator luk17Luca Bogdan luk17 Data 30 decembrie 2008 21:57:46
Problema Text Scor 60
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 kb
#include<stdio.h>
long nrcuv,lung;
char x,prec;
int main()
{
	freopen("text.in","r",stdin);
	freopen("text.out","w",stdout);
	scanf("%c",&x);
	if((x>='a'&&x<='z')||(x>='Z'&&x<='Z'))
	{
		lung++;
	nrcuv=1;
	}
	while(!feof(stdin))
	{
		prec=x;
		scanf("%c",&x);
	if(!feof(stdin)&&((x>='a'&&x<='z')||(x>='Z'&&x<='Z')))
	{
		lung++;
		if(!((prec>='a'&&prec<='z')||(prec>='Z'&&prec<='Z')))
			nrcuv++;
	}		
	}
	printf("%ld",lung/nrcuv);
	return 0;
}