SHARE
TWEET

vowel or digit

j0nze Nov 8th, 2017 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _13.Vowel_or_Digit
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string input = Console.ReadLine();
  14.            
  15.             int.TryParse(input, out int digit);
  16.             bool checker = Convert.ToBoolean(digit);
  17.  
  18.             bool lowerCase = input == "a" || input == "e" || input == "i" || input == "o" || input == "u" || input == "y";
  19.             bool upperCase = input == "A" || input == "E" || input == "I" || input == "O" || input == "U" || input == "Y";
  20.  
  21.             if (checker && (digit >= 0 && digit <= 9))
  22.             {
  23.                 Console.WriteLine("digit");
  24.             }
  25.             else if (lowerCase || upperCase)
  26.             {
  27.                 Console.WriteLine("vowel");
  28.             }
  29.             else
  30.             {
  31.                 Console.WriteLine("other");
  32.             }
  33.         }
  34.     }
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top