Last active
August 29, 2015 14:26
-
-
Save vdonchev/23ad60819e5640d9a376 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(); | |
DateTime date; | |
if (DateTime.TryParse(input, out date)) | |
{ | |
if (date.Hour >= 13 || date.Hour < 3) | |
{ | |
Console.WriteLine("beer time"); | |
} | |
else | |
{ | |
Console.WriteLine("non-beer time"); | |
} | |
} | |
else | |
{ | |
Console.WriteLine("invalid time"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment