Cod sursa(job #369234)
Utilizator | Data | 27 noiembrie 2009 16:50:01 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 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=='.'){
n++;
}
}
}
r=l/n;
printf("%d", r);
return 0;
}