#include <iostream>
#include <cstdlib>
#include <ctime>
usingnamespace std;
int main(){
srand(time(0));
int a = 1+(rand()%10);
int b = 1+(rand()%10);
int amount = 100;
int bet;
int bet1;
int bet2;
while(amount > 0 ){
cout << "\n\nYour balance is " << amount << endl;
cout << "Enter an amount to bet\n";
cin >> bet;
if(bet <= amount){
cout << "Now enter 2 numbers from 1-10\n";
cin >> bet1, bet2;
if(bet1==a && bet2==b){
amount=bet + amount;
cout << "Correct, your new balance is " << amount << endl;
}else{
amount=amount - bet;
cout << "sorry you where wrong, your new balance is " << amount << endl;
}
}else{
cout << "Inavlid amount\n";
}
}
}
So the problem I am having is that the computer remembered your bet, and you can not enter a new amount to bet, it just skips that step. So if anyone has a solution it would be much appreciated!! thanks!