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
|
#include "stdafx.h"
#include <conio.h>
#include <iostream>
#include <iomanip>
#include <stdio.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int lottonum1, lottonum2, lottonum3, lotto[3][3], amount;//random1, random2, random3,
char repeat;
do
{
srand(time(NULL));
amount = 0;
cout<<"\n\n\tEnter Lotto Number 1 : ";
cin>>lottonum1, lotto[0][0] = lottonum1;
//cout<<"\n\n\tEnter Lotto Number 2 : ";
//cin>>lottonum2, lotto[0][1] = lottonum2;
//cout<<"\n\n\tEnter Lotto Number 3 : ";
//cin>>lottonum3, lotto[0][2] = lottonum3;
lotto[1][0] = 1;//rand() % 10;
lotto[1][1] = 2;//rand() % 10;
lotto[1][2] = 3;//rand() % 10;
cout<<"\n\n\tFirst Number Drawn : "<<lotto[1][0];
cout<<"\n\tSecond Number Drawn : "<<lotto[1][1];
cout<<"\n\tThird Number Drawn : "<<lotto[1][2];
amount = 0;
cout<<"\n\tAmount before : "<<amount;
if (lotto[0][0] == lotto[1][0]){
amount =+ 100, cout<<"\n\tAmount :"<<amount;
goto sequencematch1;}
else if (lotto [0][0] != lotto[1][0]){
goto notinsequence;}
notinsequence:
if (lotto[0][0] == lotto[1][1]){
amount =+ 30, cout<<"\n\tAmount :"<<amount;
goto match1;}
else if (lotto[0][0] != lotto[1][1]){
goto match1notinsequence;}
match1notinsequence:
if (lotto[0][0] == lotto[1][2]){
amount =+ 30, cout<<"\n\tAmount :"<<amount;
goto match1;}
else if (lotto[0][0] != lotto[2][0]) {
goto nomatch1;}
sequencematch1:
cout<<"\n\t1st Number in sequence match";
match1:
cout<<"\n\t1 Match not in sequence";
nomatch1:
cout<<"\n\tNo match with first number";
cout<<"\n\n\tRepeat Program? (Y/N)";
cin>>repeat;
}while(repeat == 'y' || repeat == 'Y');
return 0;
}
|