Cod sursa(job #398660)

Utilizator cristian9Cristian Zloteanu cristian9 Data 19 februarie 2010 09:36:16
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.34 kb
#include<stdio.h>
int main()
{
	freopen ("text.in", "r", stdin);
	freopen ("text.out", "w", stdout);

	char c;
	int l=0, k=0, r, z=0;

	while(scanf("%c", &c)!=EOF){
		if('a'<=c && c<='z' || 'A'<=c && c<='Z'){
			l++;
			if(z==0){
				k++;
			}
			z=1;
		}
		else{
			z=0;
		}
	}

	r=l/k;

	printf("%d", r);

  return 0;
}