贴个card deck的,
我感觉停车场的 也可以用一用扑克牌的套路
enum Suit { SPADES, CLUBS, HEARTS, DIAMONDS, };
enum Face { ACE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK,
QUEEN, KING, };
class Card {
public:
Card(Suit suit, Face face) : suit(suit), face(face) {}
Card(const Card& orig) : suit(orig.suit), face(orig.face) {}
Suit getSuit() const { return suit; }
Face getFace() const { return face; }
private:
Card() {}
Suit suit;
Face face;
friend class Deck;
};
class Deck {
public:
Deck() {
int index = 0;
for