Sichanov

ddd

Jan 21st, 2021
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. control_unit = int(input())
  2. password = ''
  3. counter = 0
  4. is_found = False
  5. for a in range(1, 10):
  6.     for b in range(1, 10):
  7.         for c in range(1, 10):
  8.             for d in range(1, 10):
  9.                 if (a * b) + (c * d) == control_unit:
  10.                     if a < b:
  11.                         if c > d:
  12.                             print(f'{a}{b}{c}{d}', end=" ")
  13.                             counter += 1
  14.                             if counter == 4:
  15.                                 password = str(f'{a}{b}{c}{d}')
  16.                                 is_found = True
  17. print()
  18. if is_found:
  19.     print(f'Password: {password}')
  20. else:
  21.     print('No!')
Advertisement
Add Comment
Please, Sign In to add comment