SHARE
TWEET

Untitled

a guest Jul 20th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class Building {
  4.     public static void main(String[] args) {
  5.  
  6.         Scanner scanner=new Scanner(System.in);
  7.         int floor=Integer.parseInt(scanner.nextLine());
  8.         int room=Integer.parseInt(scanner.nextLine());
  9.         for(int i=floor;i>=1;i--)
  10.         {
  11.             for(int j=0;j<room;j++)
  12.                 {
  13.                     if(i==floor)
  14.                     {System.out.print("L"+floor+j+" ");}
  15.                     else if(i%2==0)
  16.                     {System.out.print("O"+i+j+" ");}
  17.                     else
  18.                     { System.out.print("A"+i+j+" ");}
  19.                 }
  20.             System.out.println(" ");
  21.         }
  22.  
  23.  
  24.     }
  25. }
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