#include <iostream>
#include <map>
#include <string>
int main() {
  std::map<std::string, std::string> value_map{
    {"A", "Ace"},
    {"2", "Two"},
    {"3", "Three"},
    {"4", "Four"},
    {"5", "Five"},
    {"6", "Six"},
    {"7", "Seven"},
    {"8", "Eight"},
    {"9", "Nine"},
    {"10", "Ten"},
    {"J", "Jack"},
    {"Q", "Queen"},
    {"K", "King"}
  };
  std::map<std::string, std::string> suit_map{
    {"D", "Diamonds"},
    {"H", "Hearts"},
    {"S", "Spades"},
    {"C", "Clubs"}
  };
  std::string cardinput;
  std::cin >> cardinput;
  std::cout << "Enter the card notation: " << cardinput << "\n";  
  if (cardinput.substr(0, 2) == "10") {
      std::cout << value_map[cardinput.substr(0, 2)] << " of " << suit_map[cardinput.substr(2, 1)] << std::endl;
  }
  else {
  std::cout << value_map[cardinput.substr(0, 1)] << " of " << suit_map[cardinput.substr(1, 1)] << std::endl;
  }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: