# include # include using namespace std; int main ( ) // // DECK prints out a symbol for every card in the deck. // // It uses a pair of nested FOR loops. // // The IF/ELSE IF/ELSE statements are squashed together without // any curly brackets, to make it easier to see what's going on, // but it is surely better and safer to include curly brackets! // { int i; int j; for ( j = 1; j <= 4; j++ ) { for ( i = 1; i <= 13; i++ ) { // // Print the number. // if ( i == 1 ) cout << "A"; else if ( i == 11 ) cout << "J"; else if ( i == 12 ) cout << "Q"; else if ( i == 13 ) cout << "K"; else cout << i; // // Print the suit. // if ( j == 1 ) cout << "H"; else if ( j == 2 ) cout << "C"; else if ( j == 3 ) cout << "D"; else cout << "S"; // // New line. // cout << "\n"; } } cout << "Joker 1\n"; cout << "Joker 2\n"; return 0; }