Cod sursa(job #508102)

Utilizator vladstoickvladstoick vladstoick Data 7 decembrie 2010 16:02:22
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include<stdio.h>
long nrlit , nrcuv , ok;
char a;
int main()
{
	freopen("text.in","r",stdin);
	freopen("text.out","w",stdout);
	while(scanf("%c",&a)!=EOF)
	{
		if( (a>='a' && a<='z') || (a>='A' && a<='Z')  )
		{
			ok=1;
			nrlit++;
		}
		else
			if(ok==1)
			{
				ok=0;
				nrcuv++;
			}
	}
	if( (a>='a' && a<='z') || (a>='A' && a<='Z')  )
	{
		nrcuv++;
	}
	printf("%ld",nrlit/nrcuv);
	return 0;
}