Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Building {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int floorCount = Integer.parseInt(scanner.nextLine());
- int roomsPerFloor = Integer.parseInt(scanner.nextLine());
- for (int i = floorCount; i > 0; i--) {
- for (int j = 0; j < roomsPerFloor; j++) {
- if (i == floorCount){
- System.out.printf("L%d%d ",i,j);
- }else if (i % 2 == 0){
- System.out.printf("O%d%d ",i,j);
- } else {
- System.out.printf("A%d%d " ,i,j);
- }
- }
- System.out.println();
- }
- }
- }
Add Comment
Please, Sign In to add comment