Skip to content

Instantly share code, notes, and snippets.

@vdonchev
Created July 31, 2015 06: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/aad4813dfc1f8498f327 to your computer and use it in GitHub Desktop.
Save vdonchev/aad4813dfc1f8498f327 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);
Console.WriteLine((date.Hour >= 13 || date.Hour < 3) ? "beer time" : "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