Advertisement
ALEXANDAR_GEORGIEV

the_song_of_the_wheels

Jun 12th, 2022
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. m = int(input())    # 4 - 144
  2. list_num = []
  3. # pass format: abcd
  4. # m = a*b + c*d
  5. # a < b
  6. # c > d
  7. # a, b, c, d (1 - 9)
  8. # Търсим 4-тото число !!!!
  9. check_find = False
  10. password = False
  11. for i in range(1, 10):
  12.     for j in range(1, 10):
  13.         for k in range(1, 10):
  14.             for l in range(1, 10):
  15.                 if m == i * j + k * l and j > i and k > l:
  16.                     list_num.append(str(i) + str(j) + str(k) + str(l))
  17.                     check_find = True
  18. if len(list_num) >= 4:
  19.     password = True
  20.  
  21. # if check_find:
  22.  
  23.  
  24. if password:
  25.     for numbers in list_num:
  26.         print(numbers, end=' ')
  27.     print()
  28.     print(f'Password: {list_num[3]}')
  29.  
  30. if not password:
  31.     print('No!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement