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 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
|
#include <iostream>
using namespace std;
//Variables
int lottoanswer;
int ticketnum;
//Functions
int tickets(int ticketnum, int ptr);
int run();
int main()
{
int lottomax[7] = {8, 16, 24, 27, 30, 38, 40}, *ptr;
ptr = &lottomax[0];
int lotto649[6] = {3, 8, 15, 16, 20, 46}, *ptr2;
ptr2 = &lotto649[0];
int ontario49[6] = {1, 10, 12, 29, 46, 47}, *ptr3;
ptr3 = &ontario49[0];
int lottario[6] = {3, 10, 11, 13, 19, 31}, *ptr4;
ptr4 = &lottario[0];
int pick4[4] = {4, 4, 1, 8}, *ptr5;
ptr5 = &pick4[0];
int pick3[3] = {3, 4, 7}, *ptr6;
ptr6 = &pick3[0];
cout << "Super Lotto" << endl;
cout << "---------------------------" << endl;
cout << endl;
cout << "Please Choose Your Ticket" << endl;
cout << endl;
cout << "1 - Lotto Max" << endl;
cout << "2 - Lotto 649" << endl;
cout << "3 - Ontario 49" << endl;
cout << "4 - Pick 4" << endl;
cout << "5 - Pick 3" << endl;
cout << endl;
cout << "---------------------------" << endl;
tickets(ticketnum,ptr);
system("pause");
}
int tickets(int ticketnum, int *po)
{
int x;
x = 2;
while(x>1)
{
cin >>lottoanswer;
if (lottoanswer == 1)
{
cout << endl;
cout << "What is your ticket number?" << endl;
cout << endl;
cin >> ticketnum;
cout << *po << endl;
cout << "---------------------------" << endl;
x = 0;
}
if (lottoanswer == 2)
{
cout << endl;
cout << "What is your ticket number?" << endl;
cout << endl;
cin >> ticketnum;
cout << "---------------------------" << endl;
x = 0;
}
if (lottoanswer == 3)
{
cout << endl;
cout << "What is your ticket number?" << endl;
cout << endl;
cin >> ticketnum;
cout << "---------------------------" << endl;
x = 0;
}
if (lottoanswer == 4)
{
cout << endl;
cout << "What is your ticket number?" << endl;
cout << endl;
cin >> ticketnum;
cout << "---------------------------" << endl;
x = 0;
}
if (lottoanswer == 5)
{
cout << endl;
cout << "What is your ticket number?" << endl;
cout << endl;
cin >> ticketnum;
cout << "---------------------------" << endl;
x = 0;
}
if (lottoanswer > 5)
{
cout <<endl;
cout << "Please choose a valid choice" << endl;
cout << endl;
cout << "---------------------------" << endl;
}
}
cout << "Done" << endl;
}
| |