Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _7._Print_Deck_of_Cards
- {
- class Program
- {
- static void Main(string[] args)
- {
- string card = Console.ReadLine();
- int cardNum;
- if (card == "A")
- {
- cardNum = 14;
- }
- else if (card == "K")
- {
- cardNum = 13;
- }
- else if (card == "Q")
- {
- cardNum = 12;
- }
- else if (card == "J")
- {
- cardNum = 11;
- }
- else
- {
- cardNum = int.Parse(card);
- }
- for (int i = 0; i < cardNum - 1; i++)
- {
- if (i == 9)
- {
- Console.WriteLine("J of spades, J of clubs, J of hearts, J diamonds");
- }
- else if (i == 10)
- {
- Console.WriteLine("Q of spades, Q of clubs, Q of hearts, Q diamonds");
- }
- else if (i == 11)
- {
- Console.WriteLine("K of spades, K of clubs, K of hearts, K diamonds");
- }
- else if (i == 12)
- {
- Console.WriteLine("A of spades, A of clubs, A of hearts, A diamonds");
- }
- else
- {
- Console.WriteLine($"{i + 2} of spades, {i + 2} of clubs, {i + 2} of hearts, {i + 2} diamonds");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement