hist.c
contents ::
  address.c
  atquick_sort.c
  bits.c
  countspace.c
  ctof.c
  hextoint.c
  hist.c
  indexof.c
  itob.c
  linkage.c
  lzw.c
  maxval.c
  merge.c
  merge_sort.c
  peof.c
  pointer.c
  quick2.c
  quick.c
  quick_sort.c
  reverse.c
  rftoc.c
  rmultiblank.c
  rtabs.c
  squeeze.c
  structoo.c
  syscall.c
  tempfunc.c
  tfc.c
  word.c

#include <stdio.h>

main(){
  enum boolean { OUT, IN };
  int c, nw, state, i;
  float max, temp;
  int x, y;
  float wlength[30];
  state = OUT;
  nw = max = temp = 0;

  for(i = 0; i<nw; ++i)
    wlength[i]=0;

  while((c=getchar())!=EOF){
    if(c==' '||c=='\n'||c=='\t'){
      state = OUT;
      if(temp>max){
         max = temp;
         temp = 0;
      }
    } else if(state==OUT){
      state = IN;
      ++nw;
    } 
    if(c!=' '||c!='\n'||c!='\t'){
      ++wlength[nw];
      ++temp;
    }
  }

  for(x = max; x >= 1; --x){
    printf("%d", x);
    if(x<10) printf(" ");
    for(y = 0; y < nw; ++y){
      if(wlength[y]>=x)
         printf("*");
      else printf(" ");
      printf(" ");
    }
    printf("\n");
  }

  for(y = 0; y < nw; ++y){
    if(y==0)
      printf(" ");
    printf(" ");
    printf("%d", y);
  } 

 for(y = 0; y < nw; ++y){
    printf("\n");
    printf("%.0f", wlength[y]);
  }
  printf("\n");
  return 0;
}

James Little