Advertisement
Guest User

sdaf

a guest
Jan 20th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class aLPAP4 {
  4. public static void main(String[] args) {
  5. char[] array = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
  6. int[][] grid = new int[9][6];
  7. int counter = 0;
  8. for(int row = 0; row < grid.length; row++) {
  9. if (row%2 != 0) {
  10. System.out.print("\t");
  11. for(int col = 0; col < grid[0].length-1; col++) {
  12. if (counter == 26) counter = 0;
  13. System.out.print(array[counter] + "\t\t");
  14. counter++;
  15. }
  16. }
  17. else {
  18. for(int col = 0; col < grid[0].length; col++) {
  19. if (counter == 26) counter = 0;
  20. System.out.print(array[counter] + "\t\t");
  21. counter++;
  22. }
  23. }
  24. System.out.println("\n");
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement