Advertisement
Guest User

Untitled

a guest
May 26th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. public class FizzBuzz {
  2. public static void main(String[] args) {
  3. int a = 1;
  4. int arr[][] = new int[7][15];
  5. for (int i = 0; i < 7; i++) {
  6.  
  7. for (int j = 0; j < 15; j++) {
  8. if (a <= 100) {
  9. arr[i][j] = a;
  10. a++;
  11. if ((j == 2) || (j == 5) || (j == 8) || (j == 11)) {
  12. System.out.print("Fizz ");
  13. } else if ((j == 4) || (j == 9)) {
  14. System.out.print("Buzz ");
  15. } else if ((j == 14)) {
  16. System.out.print("FizzBuzz ");
  17. } else {
  18. System.out.print(arr[i][j] + " ");
  19. }
  20. }
  21. }
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement