Cod sursa(job #369238)

Utilizator cristian9Cristian Zloteanu cristian9 Data 27 noiembrie 2009 16:59:03
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.36 kb
#include<stdio.h>
int main()
{freopen ("text.in", "r", stdin);
freopen ("text.out", "w", stdout);
char c;
int n=0,l=0,r=0,z=0;
while(scanf("%c", &c)!=EOF){
	if('a'<=c&&'c'<='z'||'A'<=c&&c<='Z'){
		l++;
		z=1;
	}
	if(z==1){
		if(c==' '||c=='-'||c==','||c=='.'||c==';'||c==':'||c=='!'||c=='?'){
			n++;
		}
	}
}
r=l/n;
printf("%d", r);
return 0;
}