Created
January 4, 2017 09:41
-
-
Save mes51/16f6aa61d9454a041ea26500efbd935f to your computer and use it in GitHub Desktop.
FizzBuzz
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
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