Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. public class FizzBuzzGame {
  2. public static void main(String[] args){
  3.  
  4.  
  5. for (int ii = 1; ii < 101; ii++){
  6.  
  7. if (ii % 3 == 0){
  8.  
  9. System.out.print("Fizz");
  10.  
  11. if (ii % 5 == 0){
  12.  
  13. System.out.println("Buzz");
  14.  
  15. } else {
  16.  
  17. System.out.println("");
  18.  
  19. }
  20.  
  21. } else if (ii % 5 == 0){
  22.  
  23. System.out.println("Buzz");
  24.  
  25. } else {
  26.  
  27. System.out.println(ii);
  28.  
  29. }
  30.  
  31. }
  32.  
  33. }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement