Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = int(input()) # 4 - 144
- list_num = []
- # pass format: abcd
- # m = a*b + c*d
- # a < b
- # c > d
- # a, b, c, d (1 - 9)
- # Търсим 4-тото число !!!!
- check_find = False
- password = False
- for i in range(1, 10):
- for j in range(1, 10):
- for k in range(1, 10):
- for l in range(1, 10):
- if m == i * j + k * l and j > i and k > l:
- list_num.append(str(i) + str(j) + str(k) + str(l))
- check_find = True
- if len(list_num) >= 4:
- password = True
- # if check_find:
- if password:
- for numbers in list_num:
- print(numbers, end=' ')
- print()
- print(f'Password: {list_num[3]}')
- if not password:
- print('No!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement