Random Numbers

From GCHSWiki
Jump to: navigation, search
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstring>
#include <cstdlib>
#include <ctime> 

using namespace std;

int main()
{
srand( time( NULL ) );
double stay = 0.0;
double change = 0.0;
double switching = 0.0;
double staying = 0.0;
int counter = 0;

     for (int i = 0; i < 100000; i++)
     {
	  
         int prize = 1 + rand() % 3;
         int player = 1 + rand() % 3;