Cod sursa(job #733721)

Utilizator gabrielvGabriel Vanca gabrielv Data 12 aprilie 2012 20:25:05
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
using namespace std;
#include<cstdio>
long long letter,nrcuv,k;
int main()
{
	freopen("text.in","r",stdin);
	freopen("text.out","w",stdout);
	char chs='0';
	while(chs!='\n')
	{
		scanf("%c",&chs);
		if((('a'<=chs)&&(chs<='z'))||(('A'<=chs)&&(chs<='Z')))
		{
			letter++;
			k++;
		}
		else
			if(ok)
			{
				ok=0;
				nrcuv++;
			}
	}
	if(nrcuv)
		printf("%d\n",letter/nrcuv);
	else
		printf("%d\n",letter+1);
	return 0;
}