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