Cod sursa(job #110593)

Utilizator paulDeac Adrian paul Data 26 noiembrie 2007 23:35:40
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.34 kb
#include<stdio.h>
#include<ctype.h>

#define in "text.in"
#define out "text.out"

int len,cuv,k;
char c;

int main()
{
	freopen(in,"r",stdin);
	freopen(out,"w",stdout);
	while(scanf("%c",&c)!=EOF)
	{
		if(isalpha(c))
		{
			len++;
			if(k==0)
				cuv++;
			k=1;
		}
		else
			k=0;
	}
	printf("%d",len/cuv);
	return 0;
}