Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # всички етажи от последния към първия -> [count_floors, 1]
- # на всеки етаж обхождам всички стаи -> [0, count_rooms)
- count_floors = int(input())
- count_rooms = int(input())
- for floor in range(count_floors, 0, -1):
- for room in range(0, count_rooms):
- # тип на стаята зависи от етажа -> последен L, четен O, нечетен A
- # {буква}{етаж}{стая} {буква}{етаж}{стая}
- if floor == count_floors: # последен
- print(f"L{floor}{room} ", end="")
- elif floor % 2 == 0: # четен
- print(f"O{floor}{room} ", end="")
- else: # нечетен
- print(f"A{floor}{room} ", end="")
- print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement