Cod sursa(job #396433)

Utilizator taseTanase Alexandru tase Data 15 februarie 2010 12:42:44
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.59 kb
#include<stdio.h>
#include<string.h>

#define N 1500000
char s,x;
int nrc,nrl,i;

int litera(char c)
{
	if( (c <= 'Z') && (c >= 'A') )
		return 1;
	if( (c <= 'z') && (c >= 'a') )
		return 1;
	return 0;
}

int main()
{
	
	freopen("text.in","r",stdin);
	freopen("text.out","w",stdout);
	
	//fgets(s,N,stdin);
	scanf("%c",&s);
	
	if(litera(s) == 1) 
	{
		++nrc;
		++nrl;
	}
	while(scanf("%c",&x) != EOF)
	{
		if(litera(x) == 1)
			++nrl;
		if((litera(x) == 1) && (litera(s) == 0))
			++nrc;
		s =x;
	}
	printf("%d\n",nrl/nrc);
	//printf("%d\n",nrc);
	return 0;
}