Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. public class Skuska
  2. {
  3.  
  4. public static void main(String[] args)
  5. {
  6. int i;
  7. for (i = 1; i <=100; i++) //cyklus 1 az 100
  8. {
  9. if ((i % 3) == 0 & (i % 5) != 0) System.out.print("Fizz\t"); //overuje delitelnost 3
  10. if ((i % 3) != 0 & (i % 5) == 0) System.out.print("Buzz\t"); //overuje delitelnost 5
  11. if ((i % 3) == 0 & (i % 5) == 0) System.out.print("FizzBuzz"); //overuje delitelnost 3 aj 5
  12. if ((i % 3) != 0 & (i % 5) != 0) System.out.print(i + "\t");
  13. if ((i % 10) == 0) System.out.println(); //odsadenie po 10 riadkoch
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement