Advertisement
nq1s788

5 (16 решуегэ десятичные)

Jan 17th, 2024
769
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. answ = 1000000000
  2. for n in range(1000, 10000):
  3.     s = str(n)
  4.     a = int(s[0]) + int(s[1])
  5.     b = int(s[1]) + int(s[2])
  6.     c = int(s[2]) + int(s[3])
  7.     l = sorted([a, b, c])
  8.     s = str(l[1]) + str(l[2])
  9.     if s == '1517':
  10.         answ = min(answ, n)
  11. print(answ)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement