Skip to content

Instantly share code, notes, and snippets.

@IvanNikolov
Created October 15, 2014 10:46
Show Gist options
  • Save IvanNikolov/bab8dfc6a61c1475795a to your computer and use it in GitHub Desktop.
Save IvanNikolov/bab8dfc6a61c1475795a to your computer and use it in GitHub Desktop.
using System;
//Classical play cards use the following signs to designate the card face:
//2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K and A.
//Write a program that enters a string and prints “yes”
//if it is a valid card sign or “no” otherwise. Examples:
//character Valid card sign?
// 5 yes
// 1 no
// Q yes
// q no
// P no
// 10 yes
class CheckForPlayCard
{
static void Main()
{
string cardSign = Console.ReadLine();
switch (cardSign)
{
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "10":
case "A":
case "J":
case "K":
case "Q":
Console.WriteLine("yes");
break;
default:
Console.WriteLine("no");
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment