f0rc3ful

Print Deck of Cards

Jan 27th, 2023
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. string input = Console.ReadLine();
  2. if (input == "A")
  3. {
  4. for (int a = 2; a <= 10; a++)
  5. {
  6. Console.WriteLine($"{a} of spades, {a} of clubs, {a} of hearts, {a} of diamonds");
  7. if (a == 10)
  8. {
  9. Console.WriteLine("J of spades, J of clubs, J of hearts, J of diamonds");
  10. Console.WriteLine("Q of spades, Q of clubs, Q of hearts, Q of diamonds");
  11. Console.WriteLine("K of spades, K of clubs, K of hearts, K of diamonds");
  12. Console.WriteLine("A of spades, A of clubs, A of hearts, A of diamonds");
  13. }
  14. }
  15.  
  16. }
  17. if (input == "K")
  18. {
  19. for (int a = 2; a <= 10; a++)
  20. {
  21. Console.WriteLine($"{a} of spades, {a} of clubs, {a} of hearts, {a} of diamonds");
  22. if (a == 10)
  23. {
  24. Console.WriteLine("J of spades, J of clubs, J of hearts, J of diamonds");
  25. Console.WriteLine("Q of spades, Q of clubs, Q of hearts, Q of diamonds");
  26. Console.WriteLine("K of spades, K of clubs, K of hearts, K of diamonds");
  27. }
  28. }
  29.  
  30. }
  31. else if (input == "Q")
  32. {
  33. for (int a = 2; a <= 10; a++)
  34. {
  35. Console.WriteLine($"{a} of spades, {a} of clubs, {a} of hearts, {a} of diamonds");
  36. if (a == 10)
  37. {
  38. Console.WriteLine("J of spades, J of clubs, J of hearts, J of diamonds");
  39. Console.WriteLine("Q of spades, Q of clubs, Q of hearts, Q of diamonds");
  40. }
  41. }
  42.  
  43. }
  44. else if (input == "J")
  45. {
  46. for (int a = 2; a <= 10; a++)
  47. {
  48. Console.WriteLine($"{a} of spades, {a} of clubs, {a} of hearts, {a} of diamonds");
  49. if (a == 10) { Console.WriteLine("J of spades, J of clubs, J of hearts, J of diamonds"); }
  50. }
  51.  
  52. }
  53. else
  54. {
  55. int inputi = int.Parse(input);
  56. for (int a = 2; a <=inputi; a++)
  57. {
  58. Console.WriteLine($"{a} of spades, {a} of clubs, {a} of hearts, {a} of diamonds");
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment