Cod sursa(job #714942)

Utilizator Vladtz7Dinu Vlad Vladtz7 Data 16 martie 2012 12:49:03
Problema Text Scor 100
Compilator c Status done
Runda Arhiva de probleme Marime 0.34 kb
#include <stdio.h>
#include <string.h>

int main()
{
	int i,j,k,n,x,rez;
	char c;
	freopen("text.in","r",stdin);
	freopen("text.out","w",stdout);
	
	k=1;x=0;rez=0;
	while (scanf("%c",&c)!=EOF)
	{
		if (((c>='a')&&(c<='z'))||((c>='A')&&(c<='Z')))
		{
			k=0;x++;
		}
		else if (k==0) rez++,k=1;
	}
	printf("%d",x/rez);
	return 0;

}