Cod sursa(job #485101)
Utilizator | Data | 17 septembrie 2010 02:28:44 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | c | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <stdio.h>
#include <ctype.h>
int main(void) {
int ch, nr_lit = 0, nr_cuv = 0, i = 0;
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
while((ch = getchar()) != EOF) {
if(isalpha(ch)) {
++nr_lit;
if(i)
++nr_cuv;
i = 1;
} else
i = 0;
}
printf("%d\n", nr_lit / nr_cuv);
return 0;
}