Cod sursa(job #368920)
Utilizator | Data | 26 noiembrie 2009 16:55:17 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <stdio.h>
int main ()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
int cuv,lit,lpc,ras;
char c;
cuv=0;
lit=0;
lpc=0;
while(scanf("%c",&c)!=EOF){
if('A'<=c&&c<='Z'||'a'<=c&&c<='z'){
lit=lit+1;
lpc=lpc+1;
} else {
if (lpc > 0) {
lpc=0;
cuv=cuv+1;
}
}
}
ras=lit/cuv;
printf("%d",ras);
return 0;
}