Instantly share code, notes, and snippets.

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