Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args){
- for(int i = 1; i < 101; i++){
- String print = (i % 3 == 0) ? "fizz" : (i % 5 == 0) ? "buzz" : (i % 15 == 0) ? "fizzbuzz" : "" + i;
- System.out.println(print);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement