Skip to content

Instantly share code, notes, and snippets.

@michael-simons
Created January 13, 2021 16:51
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 michael-simons/197872b367ed128e2fbbf9a331ea2f88 to your computer and use it in GitHub Desktop.
Save michael-simons/197872b367ed128e2fbbf9a331ea2f88 to your computer and use it in GitHub Desktop.
///usr/bin/env jbang "$0" "$@" ; exit $?
import static java.lang.System.*;
public class fizzbuzz {
public static void main(String... args) {
for (int i = 1; i <= 100; i++) {
if (i % 3 == 0) out.print("Fizz");
if (i % 5 == 0) out.print("Buzz");
else if (i % 3 != 0) out.print(i);
out.println();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment