Cod sursa(job #419298)

Utilizator Adela_BaciuAdela Baciu Adela_Baciu Data 17 martie 2010 11:49:52
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include<cstdio>
int nc,nch;
char ch,chant;
int main()
{
	freopen("text.in","r",stdin);
	freopen("text.out","w",stdout);
	nc=0;
	nch=0;
	chant='a';
	while(scanf("%c",&ch)!=EOF)
	{
		if(('a'<=ch&&ch<='z')||('A'<=ch&&ch<='Z'))
		{
			nch++;
		}
		if(!((('a'<=chant&&chant<='z')||('A'<=chant&&chant<='Z'))))
		{
			nc++;
		}
		chant=ch;
	}
	printf("%d",nch/nc);
	return 0;
}