Skip to content

Instantly share code, notes, and snippets.

@mes51
Created January 4, 2017 09:41
Show Gist options
  • Save mes51/16f6aa61d9454a041ea26500efbd935f to your computer and use it in GitHub Desktop.
Save mes51/16f6aa61d9454a041ea26500efbd935f to your computer and use it in GitHub Desktop.
FizzBuzz
class Main
{
public static void main (String[] args) throws java.lang.Throwable
{
if (new Main(100, "") == null) { }
}
Main(int n, String p) throws java.lang.Throwable {
if (n > 0 && new Main(n - 1, (n % 3 == 0 && n % 5 == 0 ? "FizzBuzz" : (n % 3 == 0 ? "Fizz" : (n % 5 == 0 ? "Buzz" : n))) + "\n" + p) != null) { }
else if (java.io.PrintStream.class.getMethod("println", String.class).invoke(System.out, p) == null) { }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment