Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.lang.*;
- import java.io.*;
- class Ideone {
- public static void main (String[] args) {
- for (int i = 0, count3 = 0, count5 = 0; i <= 100; ++i, ++count3, ++count5) {
- System.out.println(i + (count3 == 3 && 0 == (count3 = 0) ? "Fizz" : "")
- + (count5 == 5 && 0 == (count5 = 0) ? "Buzz" : ""));
- }
- }
- }
Add Comment
Please, Sign In to add comment