All pastes #35098 Raw Edit

Untitled

public text v1 · immutable
#35098 ·published 2005-12-28 22:23 UTC
rendered paste body
#include <stdio.h>

int main()
{
     int c, len[11], cl, i, j;

     for (i = 0; i < 11; i++)
          len[i] = 0;

     cl = 0;

     while ((c = getchar()) != EOF) {
          if (c == ' ' || c == '\n' || c == '\t') {
               if (cl >= 10)
                    ++len[10];
               else
                    ++len[cl];
               cl = 0;

          } else {
               ++cl;
          }
     }

     for (i = 0; i < 11; i++) {
          if (i == 10)
               printf("Other:\t");
          else
               printf("%d:\t", i);

          for (j = 0; j <= len[i]; j++)
               printf("=");

          printf("\n");
     }
}