Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class CheckForPlayCard
- {
- static void Main()
- {
- string card;
- do
- {
- Console.WriteLine("Enter card:");
- card = Console.ReadLine();
- if (card.Length > 1)
- {
- Console.WriteLine("Please, enter one symbol only.");
- }
- } while (card.Length > 1);
- const string deck = "23456789JQKA";
- double i = deck.IndexOf(card);
- if (i == -1)
- {
- Console.WriteLine("no");
- }
- else
- {
- Console.WriteLine("yes");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement