SHARE
TWEET

Untitled

a guest Mar 26th, 2020 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;
  2.  
  3. public class Building {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int floors = Integer.parseInt(scanner.nextLine());
  7.         int rooms = Integer.parseInt(scanner.nextLine());
  8.         for (int i = floors; i > 0  ; i--) {
  9.             for (int j = 0; j < rooms; j++) {
  10.                 if (i ==floors){
  11.                     System.out.printf("L%d%d ",i,j);
  12.  
  13.                 }else {
  14.                     if (i % 2 ==0){
  15.                         System.out.printf("O%d%d ",i,j);
  16.                     }else {
  17.                         System.out.printf("A%d%d ",i,j);
  18.                     }
  19.                 }
  20.  
  21.  
  22.             }
  23.             System.out.println();
  24.  
  25.         }
  26.  
  27.  
  28.     }
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top