Cod sursa(job #518089)

Utilizator ioanabIoana Bica ioanab Data 30 decembrie 2010 15:05:02
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <cstdio>
using namespace std;

long nr,nrcuv,ok;
char a;

int main()
{
	freopen("text.in","r",stdin);
	freopen("text.out","w",stdout);

	while(scanf("%c",&a)!=EOF)
	{
		if( (a>='a' && a<='z') || (a>='A' && a<='Z')  )
		{
			ok=1;
			nr++;
		}
		else
			if(ok==1)
			{
				ok=0;
				nrcuv++;
			}
	}
	if( (a>='a' && a<='z') || (a>='A' && a<='Z')  )
	{
		nrcuv++;
	}
	printf("%ld",nr/nrcuv);
	return 0;
}