Skip to content

Instantly share code, notes, and snippets.

@Shadey
Created September 10, 2014 17:22
Show Gist options
  • Save Shadey/8105de78f50bb6daae33 to your computer and use it in GitHub Desktop.
Save Shadey/8105de78f50bb6daae33 to your computer and use it in GitHub Desktop.
import java.util.stream.IntStream;
public class FizzBuzz {
public static void main(String[] args) {
IntStream.range(1,101).forEach(i->{
String result = (i % 15 == 0) ? "FizzBuzz":
(i % 3 == 0) ? "Fizz" :
(i % 5 == 0) ? "Buzz" :
Integer.toString(i);
System.out.println(result);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment