All pastes #433603 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-04-10 22:01 UTC
rendered paste body
// hw6.cpp : Defines the entry point for the console application.
//
#include <stdlib.h> 
#include <time.h>
#include<stdio.h>
#include<stdafx.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};
 int srand(int 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;
}