Pagini recente » Monitorul de evaluare | Monitorul de evaluare | Profil BogdyS | Diferente pentru utilizator/dornescuvlad intre reviziile 74 si 73 | Cod sursa (job #634319)
Cod sursa(job #634319)
#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();
}
if (cTot > 0)
++cWords;
}
printf("%d\n", cTot/cWords);
return 0;
}