Pagini recente » Cod sursa (job #696362) | Cod sursa (job #2112335) | Cod sursa (job #1675060) | Cod sursa (job #1535465) | Cod sursa (job #634310)
Cod sursa(job #634310)
#include <stdio.h>
#include <ctype.h>
int main()
{
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
char c;
int cWords, cTot;
cWords = cTot = 0;
c = getchar();
while (c != EOF) {
while (isalpha(c)) {
++cTot;
c = getchar();
}
while (!isalpha(c) && c != EOF) {
c = getchar();
}
++cWords;
}
printf("%d\n", cTot/cWords);
return 0;
}