1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
#include "stdafx.h"
#include <iostream>
#include <math.h>
#include <ctime> // Needed for the true randomization
#include <cstdlib>
using namespace std;
int main()
{
int repeat;
int xRan;
char end;
while (true){
end;
xRan;
repeat = 50;
int Result[13] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
while (repeat > 0){
srand(time(NULL));
xRan = rand() % 36 + 1; // Randomizing the number between 1-36.
if (xRan == 1){
Result[2]++; goto ha;
}
else if (xRan == 2, 3){
Result[3]++; goto ha;
}
else if(xRan == 4, 5, 6){
Result[4]++; goto ha;
}
else if (xRan == 7, 8, 9, 10){
Result[5]++; goto ha;
}
else if (xRan == 11, 12, 13, 14, 15){
Result[6]++; goto ha;
}
else if (xRan == 16, 17, 18, 19, 20, 21){
Result[7]++; goto ha;
}
else if (xRan == 22, 23, 24, 25, 26){
Result[8]++; goto ha;
}
else if (xRan == 27, 28, 29, 30){
Result[9]++; goto ha;
}
else if (xRan == 31, 32, 33){
Result[10]++; goto ha;
}
else if (xRan == 34, 35){
Result[11]++; goto ha;
}
else if (xRan == 36){
Result[12]++; goto ha;
}
ha:
cout << xRan;
system("PAUSE");
repeat--;
}
cout << Result[2], Result[3], Result[4], Result[5], Result[6], Result[7], Result[8], Result[9], Result[10], Result[11], Result[12];
cin >> end;
}
return 0;
}
|