Advertisement
Fundamentalen

PrintADeckOf52Cards

Mar 23rd, 2014
1,389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. using System;
  2.  
  3. class PrintADeckOf52Cards
  4. {
  5.     static void Main()
  6.     {
  7.         string[] cards = { "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A" };
  8.         int[] colors = { 3, 4, 5, 6 };
  9.  
  10.         foreach (var card in cards)
  11.         {
  12.             foreach (var color in colors)
  13.             {
  14.                 Console.Write(card);
  15.                 Console.Write((char)color + " ");
  16.             }
  17.  
  18.             Console.WriteLine();
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement