int num;
int menuchoice;
char input;
float bet = 's';
// Suspend program for 2 seconds
Sleep(2000);
//seed random number ganerator using the system clock
srand(static_cast<unsigned int> (time(0)));
//generate a random number between 1 and 13
num = rand() % 13 + 1;
// Welcome user to the introduction screen
cout << " BLACKJACK\n\n\n";
cout << " Thank you for playing this game!\n\n";
cout << " Press 'b' to Start the game\n";
cout << " Press 'i' for intructions on the game\n";
cout << " Press 'c' for credits on the game\n";
// Show the instructions
cin >> input;
if (input == 'i')
{
cout << " The game you will be playing is called 'Blackjack' or 'twenty-one'.\n This is a multiplayer games in which one of the players want to get cards";
}
cin >> input;
if (input == 'c')
{
cout << " The writer, producer, developer, and artist of this game is";
}
cin >> input;
if (input == 'b')
{
do
{
//Tell the user what card they got
cout << " You got" << num;
// Add up all the user"s cards and print
// Ask them if the y want to hit or stay
cout << " Would you like to get hit ('h') or stay ('s')";
//If they want to hit, loop back to generating a random number again otherwise let the computer get a hand
// Let Player 1 go first
cout << " Player 1's turn!!!";
// Tell the player what card they got
cout << " You got" << num;
// Add up all the user"s cards and print
// Ask them if the y want to hit or stay
cout << " Would you like to get hit ('h') or stay ('s')";
//If they want to hit, loop back to generating a random number again otherwise let the computer get a hand
cin >> choice;
}while (choice == 'h');
In the "Add up all the user's cards and print" the total is supposed to be 'num', but num has to be used for several different numbers, so how do I add all those 'nums' to make a 'total' ?