Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement