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