Cod sursa(job #419320)

Utilizator Adela_BaciuAdela Baciu Adela_Baciu Data 17 martie 2010 12:01:18
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.38 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=' ';
	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;
}