Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic; // not needed
- /// <summary>
- /// Write a program that generates and prints all possible cards from a
- /// standard deck of 52 cards (without the jokers). The cards should be
- /// printed using the classical notation (like 5♠, A♥, 9♣ and K♦). The card
- /// faces should start from 2 to A. Print each card face in its four possible
- /// suits: clubs, diamonds, hearts and spades. Use 2 nested for-loops and a
- /// switch-case statement.
- /// </summary>
- public class PrintCardDeck
- {
- static void Main()
- {
- string[] cards = { "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A" };
- char[] suit = { '♠', '♥', '♣', '♦' };
- for (int i = 0; i < cards.Length; i++)
- {
- for (int j = 0; j < suit.Length; j++)
- {
- Console.WriteLine(cards[i] + suit[j]);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement