Skip to content

Instantly share code, notes, and snippets.

@bufferings bufferings/FizzBuzz.java
Last active Sep 4, 2018

Embed
What would you like to do?
public class FizzBuzz {
public static void main(String[] args) {
for (int i = 1; i <= 30; i++) {
int a =(int)Math.pow(0, i % 3);
int b =(int)Math.pow(0, i % 5);
System.out.print("Fizz".repeat(a));
System.out.print("Buzz".repeat(b));
System.out.println(Integer.toString(i).repeat((a ^ 1) * (b ^ 1)));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.