#include /* Create a histogram of word lengths up to 15 charachters for a given input */ int main () { int c, idx, max; max = 15; int counts[max]; while((c = getchar ()) != EOF) { if ( c == ' ' || c == '\n' || c == '\t') { counts[idx] = counts[idx] + 1; idx = 0; } else idx++; } for(idx = 0; idx < max; idx++) printf("%i\n", counts[idx]); return 0; }