Advertisement
j0nze

vowel or digit

Nov 8th, 2017
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.99 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement