#include #include #include #include using namespace std; const string FACES[13] = {"Ace", "Deuce", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"}; const string SUIT[4] = {"Diamond", "Club", "Spade", "Heart"}; class Card { friend ostream & operator<< (ostream& output, const Card & c); public: int s; int f; private: }; ostream& operator<< (ostream& output, const Card & c) { output << "Card is a " << FACES[c.f] << " of " << SUIT[c.s] << endl; return output; } void PrintVector(vector v) { for (int i=0; i < v.size(); i++) cout << v[i]; cout << endl; } void main (void) { vector v; Card c; /* for (int i=0; i < 13; i++) for (int j=0; j < 4; j++) { c.f = i; c.s = j; v.push_back(c); } */ for (int i=0; i < 52; i++) { c.f = i % 13; c.s = i / 13; v.push_back(c); } random_shuffle(v.begin(), v.end()); PrintVector(v); }