Advertisement
Guest User

Untitled

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