1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#include <iostream>
#include <string>
#include <ctime>
using namespace std;
const int number_of_cards = 52;
int main() {
string deck[number_of_cards] = {};
string suits[] = {"Clubs", "Diamonds", "Hearts", "Spades"};
string ranks[] = {"Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King"};
//int value[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
int index;
for(int x = 0; x < 4; x++) {
for(int i = 0; i < 13; i++) {
deck[index++] = ranks[i] + " of " + suits[x];
}
}
for(int x = 0; x < number_of_cards; x++)
cout << deck[x] << endl;
return 0;
}
|