Pagini recente » Cod sursa (job #1188456) | Cod sursa (job #538939) | Cod sursa (job #2044939) | Cod sursa (job #1820412) | Cod sursa (job #547503)
Cod sursa(job #547503)
#include <stdio.h>
#include <ctype.h>
#define IN "text.in"
#define OUT "text.out"
int main(void) {
long len_text = 0, nr_cuv = 0, cuv = 0;
char ch;
freopen(IN, "r", stdin);
freopen(OUT, "w", stdout);
while((ch = getchar()) != EOF) {
if(!ok && isalpha(ch)) ++nr_cuv, ok = 1, ++len_text;
else if(ok && isalpha(ch)) ++len_text;
else if(ok && !isalpha(ch)) ok = 0;
}
printf("%ld", len_text / nr_cuv);
return 0;
}