Skip to content

Instantly share code, notes, and snippets.

@bufferings
Last active September 4, 2018 15:34
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 bufferings/ab3d8c70e36747ffd45dc670789bbfa2 to your computer and use it in GitHub Desktop.
Save bufferings/ab3d8c70e36747ffd45dc670789bbfa2 to your computer and use it in GitHub Desktop.
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