Guest User

Untitled

a guest
Jul 17th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 7.86 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. int main() {
  8.     string tmp, value, suits, tmp2;
  9.     cin >> tmp >> value >> tmp2 >> suits;
  10.     int n;
  11.     int lines = 0;
  12.    
  13.     if(value.compare("two") == 0) { value = "2"; n = 2; }
  14.     if(value.compare("three") == 0) { value = "3"; n = 3; }
  15.     if(value.compare("four") == 0) { value = "4"; n = 4; }
  16.     if(value.compare("five") == 0) { value = "5"; n = 5; }
  17.     if(value.compare("six") == 0) { value = "6"; n = 6; }
  18.     if(value.compare("seven") == 0) { value = "7"; n = 7; }
  19.     if(value.compare("eight") == 0) { value = "8"; n = 8; }
  20.     if(value.compare("nine") == 0) { value = "9"; n = 9;}
  21.     if(value.compare("ten") == 0) { value = "10"; n = 10; }
  22.     if(value.compare("jack") == 0) { value = "J"; n = 1; }
  23.     if(value.compare("queen") == 0) { value = "Q"; n = 1; }
  24.     if(value.compare("king") == 0) { value = "K"; n = 1; }
  25.     if(value.compare("ace") == 0) { value = "A"; n = 1; }
  26.    
  27.     cout << "+-----------------------+" << endl;
  28.     if(value.compare("10") != 0){
  29.         cout << "|" << value << "                     " << value <<"|" << endl;
  30.     } else {
  31.         cout << "|" << value << "                   " << value <<"|" << endl;
  32.     }
  33.     lines += 2;
  34.    
  35.     if(n==10){
  36.         lines += 6;
  37.         if(suits.compare("hearts") == 0){
  38.             cout << "|                       |" << endl;
  39.             cout << "|          # #          |" << endl;
  40.             cout << "|         #####         |" << endl;
  41.             cout << "|          ###          |" << endl;
  42.             cout << "|           #           |" << endl;
  43.         }
  44.         if(suits.compare("diamonds") == 0){
  45.             cout << "|           #           |" << endl;
  46.             cout << "|          ###          |" << endl;
  47.             cout << "|         #####         |" << endl;
  48.             cout << "|          ###          |" << endl;
  49.             cout << "|           #           |" << endl;
  50.         }
  51.         if(suits.compare("spades") == 0){
  52.             cout << "|           #           |" << endl;
  53.             cout << "|          ###          |" << endl;
  54.             cout << "|         #####         |" << endl;
  55.             cout << "|         # # #         |" << endl;
  56.             cout << "|           #           |" << endl;
  57.         }
  58.         if(suits.compare("clubs") == 0){
  59.             cout << "|          ###          |" << endl;
  60.             cout << "|           #           |" << endl;
  61.             cout << "|         #####         |" << endl;
  62.             cout << "|         # # #         |" << endl;
  63.             cout << "|           #           |" << endl;            
  64.         }  
  65.         cout << "|                       |" << endl;
  66.         n--;
  67.     }
  68.    
  69.     if(n==9){
  70.         for(int i=0; i<(n/3); i++){
  71.             if(suits.compare("hearts") == 0){
  72.                 cout << "|                       |" << endl;
  73.                 cout << "|  # #     # #     # #  |" << endl;
  74.                 cout << "| #####   #####   ##### |" << endl;
  75.                 cout << "|  ###     ###     ###  |" << endl;
  76.                 cout << "|   #       #       #   |" << endl;
  77.             }
  78.             if(suits.compare("diamonds") == 0){
  79.                 cout << "|   #       #       #   |" << endl;
  80.                 cout << "|  ###     ###     ###  |" << endl;
  81.                 cout << "| #####   #####   ##### |" << endl;
  82.                 cout << "|  ###     ###     ###  |" << endl;
  83.                 cout << "|   #       #       #   |" << endl;
  84.             }
  85.             if(suits.compare("spades") == 0){
  86.                 cout << "|   #       #       #   |" << endl;
  87.                 cout << "|  ###     ###     ###  |" << endl;
  88.                 cout << "| #####   #####   ##### |" << endl;
  89.                 cout << "| # # #   # # #   # # # |" << endl;
  90.                 cout << "|   #       #       #   |" << endl;
  91.             }
  92.             if(suits.compare("clubs") == 0){
  93.                 cout << "|  ###     ###     ###  |" << endl;
  94.                 cout << "|   #       #       #   |" << endl;
  95.                 cout << "| #####   #####   ##### |" << endl;
  96.                 cout << "| # # #   # # #   # # # |" << endl;
  97.                 cout << "|   #       #       #   |" << endl;
  98.             }
  99.             cout << "|                       |" << endl;
  100.             lines += 6;
  101.         }
  102.        
  103.     }
  104.    
  105.     if(n<9){
  106.         if(n%2==1){
  107.             lines += 5;
  108.             if(suits.compare("hearts") == 0){
  109.                 cout << "|                       |" << endl;
  110.                 cout << "|          # #          |" << endl;
  111.                 cout << "|         #####         |" << endl;
  112.                 cout << "|          ###          |" << endl;
  113.                 cout << "|           #           |" << endl;
  114.             }
  115.             if(suits.compare("diamonds") == 0){
  116.                 cout << "|           #           |" << endl;
  117.                 cout << "|          ###          |" << endl;
  118.                 cout << "|         #####         |" << endl;
  119.                 cout << "|          ###          |" << endl;
  120.                 cout << "|           #           |" << endl;
  121.             }
  122.             if(suits.compare("spades") == 0){
  123.                 cout << "|           #           |" << endl;
  124.                 cout << "|          ###          |" << endl;
  125.                 cout << "|         #####         |" << endl;
  126.                 cout << "|         # # #         |" << endl;
  127.                 cout << "|           #           |" << endl;
  128.             }
  129.             if(suits.compare("clubs") == 0){
  130.                 cout << "|          ###          |" << endl;
  131.                 cout << "|           #           |" << endl;
  132.                 cout << "|         #####         |" << endl;
  133.                 cout << "|         # # #         |" << endl;
  134.                 cout << "|           #           |" << endl;
  135.             }
  136.             n--;
  137.         }
  138.         for(int i=0; i<(n/2); i++){
  139.             if(suits.compare("hearts") == 0){
  140.                 cout << "|                       |" << endl;
  141.                 cout << "|  # #             # #  |" << endl;
  142.                 cout << "| #####           ##### |" << endl;
  143.                 cout << "|  ###             ###  |" << endl;
  144.                 cout << "|   #               #   |" << endl;
  145.             }
  146.             if(suits.compare("diamonds") == 0){
  147.                 cout << "|   #               #   |" << endl;
  148.                 cout << "|  ###             ###  |" << endl;
  149.                 cout << "| #####           ##### |" << endl;
  150.                 cout << "|  ###             ###  |" << endl;
  151.                 cout << "|   #               #   |" << endl;
  152.             }
  153.             if(suits.compare("spades") == 0){
  154.                 cout << "|   #               #   |" << endl;
  155.                 cout << "|  ###             ###  |" << endl;
  156.                 cout << "| #####           ##### |" << endl;
  157.                 cout << "| # # #           # # # |" << endl;
  158.                 cout << "|   #               #   |" << endl;
  159.             }
  160.             if(suits.compare("clubs") == 0){
  161.                 cout << "|  ###             ###  |" << endl;
  162.                 cout << "|   #               #   |" << endl;
  163.                 cout << "| #####           ##### |" << endl;
  164.                 cout << "| # # #           # # # |" << endl;
  165.                 cout << "|   #               #   |" << endl;
  166.             }
  167.             cout << "|                       |" << endl;
  168.             lines += 6;
  169.         }
  170.     }
  171.     for(int i=lines; i<28; i++){
  172.         cout << "|                       |" << endl;
  173.         lines++;
  174.     }
  175.     if(value.compare("10") != 0){
  176.         cout << "|" << value << "                     " << value <<"|" << endl;
  177.     } else {
  178.         cout << "|" << value << "                   " << value <<"|" << endl;
  179.     }
  180.     cout << "+-----------------------+" << endl;
  181.     lines += 2;
  182. }
Add Comment
Please, Sign In to add comment