Created
January 13, 2021 16:51
-
-
Save michael-simons/197872b367ed128e2fbbf9a331ea2f88 to your computer and use it in GitHub Desktop.
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
///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