Cod sursa(job #556806)

Utilizator the@EyE@Postavaru Stefan the@EyE@ Data 16 martie 2011 12:27:06
Problema Text Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.49 kb
#include<stdio.h>
#include<string.h>

char text[1000000],nr=0,nr2=0;

bool isLet(char ch)
{
	if((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z'))return true;
	return false;
}

int main()
{
	freopen("text.in","r",stdin);
	freopen("text.out","w",stdout);
	gets(text);
	int ind=0;
	bool wasC=false;
	while(ind<strlen(text))
	{
		if(isLet(text[ind])==true)
		{
			if(wasC==false)nr++;
			nr2++;
			wasC=true;
		}
		else wasC=false;
		ind++;
	}
	printf("%d\n",nr2/nr);
	return 0;
}