All pastes #433571 Raw Edit

Stuff

public text v1 · immutable
·published 2007-04-10 21:33 UTC
rendered paste body
#include <stdlib.h> 
#include <time.h>
#include<stdio.h>

int main(void)
{
 int result;
 int count;
 int results[]={0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0};
 srand(time(NULL));
 for(count=0;count<3600;count++) {
  result=(int)(rand()%6) + (rand()%6);
  results[result]++;
 // printf("count %d result=%d\n",count,result);
 }
 for(count=0;count<11;count++) {
  printf("results[%2d]=%d\n",count+2,results[count]); // oops u need to transpose this by 2 since thats min result
 }
 printf("\n");
 return 0;
}