Mai intai trebuie sa te autentifici.

Cod sursa(job #733718)

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