Cod sursa(job #329353)

Utilizator Alexa_ioana_14Antoche Ioana Alexandra Alexa_ioana_14 Data 5 iulie 2009 22:09:21
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.52 kb
#include<cstdio>
#define N 2000005
char s[N];
void citire()
{
	freopen("text.in","r",stdin);
	freopen("text.out","w",stdout);
	fgets(s,N-1,stdin);
	bool ok;
	long long c=0,l=0;
	for (long long i=0; s[i]&&s[i]!=10; ++i)
	{
		ok=false;
		while ((s[i]<'A'&&s[i]>'Z')||(s[i]<'a'&&s[i]>'z')&&s[i]&&s[i]!=10)
			++i;
		while ((s[i]>='A'&&s[i]<='Z')||(s[i]>='a'&&s[i]<='z')&&s[i]&&s[i]!=10)
		{
			ok=true;
			++l;
			++i;
		}
		if (ok) ++c;
	}
	printf("%lld",l/c);
}
int main()
{
	citire();
	return 0;
}