Advertisement
Spocoman

06. Building

Sep 24th, 2024
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.58 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var floorCount, flatFloorCount int
  7.     var appendix string
  8.     fmt.Scanln(&floorCount)
  9.     fmt.Scanln(&flatFloorCount)
  10.      
  11.     for floor := floorCount; floor > 0; floor-- {
  12.         if floor == floorCount {
  13.             appendix = "L"
  14.         } else if floor % 2 == 1 {
  15.             appendix = "A"
  16.         } else {
  17.             appendix = "O"
  18.         }
  19.  
  20.         for flatFloor := 0; flatFloor < flatFloorCount; flatFloor++ {
  21.              fmt.Printf("%s%d%d ", appendix, floor, flatFloor)
  22.         }
  23.         fmt.Println()
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement