Advertisement
nq1s788

5 (десятичная)

Jan 13th, 2024
1,611
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. answ = 0
  2. for a in range(1, 10):
  3.     for b in range(10):
  4.         for c in range(10):
  5.             for d in range(10):
  6.                 x = a + b
  7.                 y = c + d
  8.                 if x < y:
  9.                     if str(x) + str(y) == '117':
  10.                         answ = max(answ, a * 1000 + b * 100 + c * 10 + d)
  11.                 else:
  12.                     if str(y) + str(x) == '117':
  13.                         answ = max(answ, a * 1000 + b * 100 + c * 10 + d)
  14. print(answ)
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement