Last active
August 29, 2015 14:26
-
-
Save vdonchev/ad01501f86fac73438e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Program | |
{ | |
private static void Main() | |
{ | |
string input = Console.ReadLine(); | |
try | |
{ | |
DateTime date = DateTime.Parse(input); | |
if (date.Hour >= 13 || date.Hour < 3) | |
{ | |
Console.WriteLine("beer time"); | |
} | |
else | |
{ | |
Console.WriteLine("non-beer time"); | |
} | |
} | |
catch (FormatException) | |
{ | |
Console.WriteLine("invalid time"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment