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/ad01501f86fac73438e2 to your computer and use it in GitHub Desktop.
Save vdonchev/ad01501f86fac73438e2 to your computer and use it in GitHub Desktop.
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