Advertisement
AlexG2230954

ЕГЭ № 5. Задание 2

Mar 19th, 2022
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. def F(n):
  2.     s = str(n)
  3.    
  4.     a = int(s[0])
  5.     b = int(s[1])
  6.     c = int(s[2])
  7.    
  8.     e = a + b
  9.     q = b + c
  10.    
  11.     if e < q:
  12.         e, q = q, e
  13.        
  14.     return int(str(e) + str(q))
  15.  
  16.  
  17. for i in range(100, 1_000):
  18.     if F(i) == 1711:
  19.         print(i)
  20.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement