Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string tmp, value, suits, tmp2;
- cin >> tmp >> value >> tmp2 >> suits;
- int n;
- int lines = 0;
- if(value.compare("two") == 0) { value = "2"; n = 2; }
- if(value.compare("three") == 0) { value = "3"; n = 3; }
- if(value.compare("four") == 0) { value = "4"; n = 4; }
- if(value.compare("five") == 0) { value = "5"; n = 5; }
- if(value.compare("six") == 0) { value = "6"; n = 6; }
- if(value.compare("seven") == 0) { value = "7"; n = 7; }
- if(value.compare("eight") == 0) { value = "8"; n = 8; }
- if(value.compare("nine") == 0) { value = "9"; n = 9;}
- if(value.compare("ten") == 0) { value = "10"; n = 10; }
- if(value.compare("jack") == 0) { value = "J"; n = 1; }
- if(value.compare("queen") == 0) { value = "Q"; n = 1; }
- if(value.compare("king") == 0) { value = "K"; n = 1; }
- if(value.compare("ace") == 0) { value = "A"; n = 1; }
- cout << "+-----------------------+" << endl;
- if(value.compare("10") != 0){
- cout << "|" << value << " " << value <<"|" << endl;
- } else {
- cout << "|" << value << " " << value <<"|" << endl;
- }
- lines += 2;
- if(n==10){
- lines += 6;
- if(suits.compare("hearts") == 0){
- cout << "| |" << endl;
- cout << "| # # |" << endl;
- cout << "| ##### |" << endl;
- cout << "| ### |" << endl;
- cout << "| # |" << endl;
- }
- if(suits.compare("diamonds") == 0){
- cout << "| # |" << endl;
- cout << "| ### |" << endl;
- cout << "| ##### |" << endl;
- cout << "| ### |" << endl;
- cout << "| # |" << endl;
- }
- if(suits.compare("spades") == 0){
- cout << "| # |" << endl;
- cout << "| ### |" << endl;
- cout << "| ##### |" << endl;
- cout << "| # # # |" << endl;
- cout << "| # |" << endl;
- }
- if(suits.compare("clubs") == 0){
- cout << "| ### |" << endl;
- cout << "| # |" << endl;
- cout << "| ##### |" << endl;
- cout << "| # # # |" << endl;
- cout << "| # |" << endl;
- }
- cout << "| |" << endl;
- n--;
- }
- if(n==9){
- for(int i=0; i<(n/3); i++){
- if(suits.compare("hearts") == 0){
- cout << "| |" << endl;
- cout << "| # # # # # # |" << endl;
- cout << "| ##### ##### ##### |" << endl;
- cout << "| ### ### ### |" << endl;
- cout << "| # # # |" << endl;
- }
- if(suits.compare("diamonds") == 0){
- cout << "| # # # |" << endl;
- cout << "| ### ### ### |" << endl;
- cout << "| ##### ##### ##### |" << endl;
- cout << "| ### ### ### |" << endl;
- cout << "| # # # |" << endl;
- }
- if(suits.compare("spades") == 0){
- cout << "| # # # |" << endl;
- cout << "| ### ### ### |" << endl;
- cout << "| ##### ##### ##### |" << endl;
- cout << "| # # # # # # # # # |" << endl;
- cout << "| # # # |" << endl;
- }
- if(suits.compare("clubs") == 0){
- cout << "| ### ### ### |" << endl;
- cout << "| # # # |" << endl;
- cout << "| ##### ##### ##### |" << endl;
- cout << "| # # # # # # # # # |" << endl;
- cout << "| # # # |" << endl;
- }
- cout << "| |" << endl;
- lines += 6;
- }
- }
- if(n<9){
- if(n%2==1){
- lines += 5;
- if(suits.compare("hearts") == 0){
- cout << "| |" << endl;
- cout << "| # # |" << endl;
- cout << "| ##### |" << endl;
- cout << "| ### |" << endl;
- cout << "| # |" << endl;
- }
- if(suits.compare("diamonds") == 0){
- cout << "| # |" << endl;
- cout << "| ### |" << endl;
- cout << "| ##### |" << endl;
- cout << "| ### |" << endl;
- cout << "| # |" << endl;
- }
- if(suits.compare("spades") == 0){
- cout << "| # |" << endl;
- cout << "| ### |" << endl;
- cout << "| ##### |" << endl;
- cout << "| # # # |" << endl;
- cout << "| # |" << endl;
- }
- if(suits.compare("clubs") == 0){
- cout << "| ### |" << endl;
- cout << "| # |" << endl;
- cout << "| ##### |" << endl;
- cout << "| # # # |" << endl;
- cout << "| # |" << endl;
- }
- n--;
- }
- for(int i=0; i<(n/2); i++){
- if(suits.compare("hearts") == 0){
- cout << "| |" << endl;
- cout << "| # # # # |" << endl;
- cout << "| ##### ##### |" << endl;
- cout << "| ### ### |" << endl;
- cout << "| # # |" << endl;
- }
- if(suits.compare("diamonds") == 0){
- cout << "| # # |" << endl;
- cout << "| ### ### |" << endl;
- cout << "| ##### ##### |" << endl;
- cout << "| ### ### |" << endl;
- cout << "| # # |" << endl;
- }
- if(suits.compare("spades") == 0){
- cout << "| # # |" << endl;
- cout << "| ### ### |" << endl;
- cout << "| ##### ##### |" << endl;
- cout << "| # # # # # # |" << endl;
- cout << "| # # |" << endl;
- }
- if(suits.compare("clubs") == 0){
- cout << "| ### ### |" << endl;
- cout << "| # # |" << endl;
- cout << "| ##### ##### |" << endl;
- cout << "| # # # # # # |" << endl;
- cout << "| # # |" << endl;
- }
- cout << "| |" << endl;
- lines += 6;
- }
- }
- for(int i=lines; i<28; i++){
- cout << "| |" << endl;
- lines++;
- }
- if(value.compare("10") != 0){
- cout << "|" << value << " " << value <<"|" << endl;
- } else {
- cout << "|" << value << " " << value <<"|" << endl;
- }
- cout << "+-----------------------+" << endl;
- lines += 2;
- }
Add Comment
Please, Sign In to add comment