Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- found = False
- for a in range(1, 10):
- for b in range(9, a - 1, -1):
- for c in range(0, 10):
- for d in range(9, c - 1, -1):
- if (a + b + c + d) == (a * b * c * d) and (a + b + c + d) % 10 == 5:
- print(f"{a}{b}{c}{d}")
- found = True
- break
- if (a * b * c * d) // (a + b + c + d) == 3 and n % 3 == 0:
- print(f"{d}{c}{b}{a}")
- found = True
- break
- if found:
- break
- if found:
- break
- if found:
- break
- if not found:
- print("Nothing found")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement