Last active
December 1, 2017 22:12
-
-
Save DexterHaslem/a6353cd3184796cf792c9d82146faab7 to your computer and use it in GitHub Desktop.
java fizzbuzz
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
import java.util.stream.IntStream; | |
public class Main { | |
public static void main(String[] args) { | |
IntStream.range(1, 101).forEach(i -> System.out.println(String.format("%d %s%s", i, i % 3 == 0 ? "Fizz" : "", i % 5 == 0 ? "Buzz" : ""))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment