+ 2
So I'm still having problems with this. Please tell me what I'm doing wrong.
So I am making a jackpot code but nothing is going right so please help me.
5 Respostas
+ 2
https://code.sololearn.com/cmO6mBU1mKAo/#cpp
#include <iostream>
#include <cstdlib>
#include <stdlib.h>
#include <ctime>
using namespace std;
int main(){
int max = 4;
srand(time(NULL));
int a = (rand() % max) + 1;
srand(1);
int b = (rand() % max) + 1;
srand(2);
int c = (rand() % max) + 1;
cout << "=================" << endl;
cout << "===[ JACKPOT ]===" << endl;
cout << "===|["<< a << "]";
cout << "["<< b << "]";
cout << "["<< c << "]|===" << endl;
cout << "=================" << endl;
if (a == b && a == c) {
cout<<"$$ YOU WIN $quot; << endl;
}
else {
cout << "!!! YOU LOSE !!!" << endl;
}
return 0;
}
::::::::OUTPUT:::::::::
=================
===[ JACKPOT ]===
===| [2][2][2] |===
=================
$$ YOU WIN $$
or
=================
===[ JACKPOT ]===
===| [2][3][5] |===
=================
!!! YOU LOSE !!!
+ 1
thank you so much
+ 1
Btw, I set max to 4 on the code I posted, just so there quicker chance for you to test both scenarios. Change it to 2 if you want to quickly test it out.
Best of luck to you! Hope that helps. I even took time to make it look pretty for you. lol
0
what do you mean?