Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Example program
- #include <iostream>
- #include<cstdlib>
- #include<ctime>
- using namespace std;
- int main()
- {
- //var
- int num1, num2, num3, numg1, numg2, numg3;
- //code
- cout << "Please enter your numbers to enter a lottery. --> ";
- cin >> numg1 >> numg2 >> numg3;
- srand(time(0));
- num1 = rand() % 10;
- num2 = rand() % 10;
- num3 = rand() % 10;
- if(numg1 == num1 && numg2 == num2 && numg3 == num3)
- {
- cout << "You have won $10000";
- }
- else if(numg1 == num1 || numg2 == num2 || numg3 == num3)
- {
- cout << "You have won $3000";
- }
- else
- {
- cout << "Sorry you have not won.";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement