Cod sursa(job #634317)
| Utilizator | Data | 15 noiembrie 2011 22:10:46 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | c | Status | done |
| Runda | Arhiva de probleme | Marime | 0.44 kb |
#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 %d\n", cTot, cWords);
printf("%d\n", cTot/cWords);
return 0;
}
