
#include <stdlib.h>

int nreps,hearts[6],count;

main(int argc, char **argv)

{  int i,j,nh,suit; float d;

   nreps = atoi(argv[1]);

   for (i = 0; i < nreps; i++)  {
      nh = 0;
      for (j = 0; j < 5; j++)  {
         d = (float) drand48();
         suit = 4*d;
         if (suit == 0) nh++;
      }
      hearts[nh]++;
   }

   for (i = 0; i < 6; i++)
      printf("%f\n",((float) hearts[i])/nreps);

}

