Advertisement
tedo1111

Print Deck of Cards

Jan 24th, 2023
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. using System;
  2.  
  3. class MainClass
  4. {
  5. public static void Main(string[] args)
  6. {
  7. string cardSign = Console.ReadLine();
  8. string[] suits = { "spades", "clubs", "hearts", "diamonds" };
  9.  
  10. for (int i = 2; i <= int.Parse(cardSign); i++)
  11. {
  12. string cards = "";
  13. foreach (string suit in suits)
  14. {
  15. cards += i + " of " + suit + ", ";
  16. }
  17. Console.WriteLine(cards.TrimEnd(',', ' '));
  18. }
  19. }
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement