Advertisement
Spocoman

Ticket Combination

Sep 29th, 2023
895
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. n = int(input())
  2.  
  3. for a in range(ord('B'), ord('L') + 1, 2):
  4.     for b in range(ord('f'), ord('a') - 1, -1):
  5.         for c in range(ord('A'), ord('C') + 1):
  6.             for d in range(1, 11):
  7.                 for e in range(10, 0, -1):
  8.                     n -= 1
  9.                     if n == 0:
  10.                         print(f"Ticket combination: {chr(a)}{chr(b)}{chr(c)}{d}{e}\n"
  11.                               f"Prize: {a + b + c + d + e} lv.")
  12.                         exit(0)
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement