Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class aLPAP4 {
- public static void main(String[] args) {
- 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'};
- int[][] grid = new int[9][6];
- int counter = 0;
- for(int row = 0; row < grid.length; row++) {
- if (row%2 != 0) {
- System.out.print("\t");
- for(int col = 0; col < grid[0].length-1; col++) {
- if (counter == 26) counter = 0;
- System.out.print(array[counter] + "\t\t");
- counter++;
- }
- }
- else {
- for(int col = 0; col < grid[0].length; col++) {
- if (counter == 26) counter = 0;
- System.out.print(array[counter] + "\t\t");
- counter++;
- }
- }
- System.out.println("\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement