Nikolay9

"Lucky" numbers

Oct 21st, 2022
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. a = int(input())
  2. for b in range(1, a + 1):
  3.     for c in range(1, a + 1):
  4.         for d in range(1, a + 1):
  5.             for e in range(1, a + 1):
  6.                 if b >= 10 or c >= 10 or d >= 10 or e >= 10:
  7.                     break
  8.                 if (b + c) == (d + e) and (a % (b + c) == 0):
  9.                     print(f"{b}{c}{d}{e}", end=" ")
Advertisement
Add Comment
Please, Sign In to add comment