#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define NUM 26

void chargraph(int n) {
    int j;
    for (j = 0; j < n; j++) {
        putchar('*');
    }
    putchar('\n');
}

int main(void) {
    int i, k;
    int result[NUM] = {0} ;  /* 大きさ 26（添字 0 〜 25）の配列 */
  
    srand((unsigned int)time(NULL));  /* これがないとどうなるか? */
  
    for (k = 0; k < 500; k++) {
        int sum = rand() % 6 + rand() % 6 + rand() % 6 
                  + rand() % 6 + rand() % 6; 
        result[sum]++; 
    }
 
   for (i = 0; i < NUM; i++) {
       printf("%2d ", i);
       chargraph(result[i]);
   }

   return 0;
}
