Skip to content

Instantly share code, notes, and snippets.

@vdonchev
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vdonchev/23ad60819e5640d9a376 to your computer and use it in GitHub Desktop.
Save vdonchev/23ad60819e5640d9a376 to your computer and use it in GitHub Desktop.
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