#include <iostream>
usingnamespace std;
int cardCount[12];
int cardValue[5];
int pairs = 0;
string cardName[12] = {"ace","two","three","four","five","six","seven","eight","nine","jack","queen","king"};
int main()
{
for (int i=0;i<5;i++)
{
cout << "Enter next number 0 to 12: " << endl;
cin >> cardValue[i];
}
for (int i=0;i<5;i++)
{
cardCount[cardValue[i]] = cardCount[cardValue[i]] + 1; // count how many of each type
}
for (int i=0;i<12; i++)
{
if (cardCount[i] != 0)
{
cout << "There are " << cardCount[i] << " of type " << cardName[i] << endl;
if (cardCount[i] == 2)
cout << "one pair of " << cardName[i] << endl;
if (cardCount[i] == 4)
cout << "four of a kind " << cardName[i] << endl;
}
}
return 0;
}