Help with some code

Ok, so I am making a simple betting game here is the code

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
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace 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!
Line 23cin >> bet1, bet2;

Should be

cin >> bet1 >> bet2;
Thank you very much! that solved my problem
Topic archived. No new replies allowed.