Advertisement
stupid_pro

1

Jan 29th, 2023
826
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. def alg(n):
  2.     s = str(n)
  3.     sum1 = int(s[0]) + int(s[1])
  4.     sum2 = int(s[2]) + int(s[3])
  5.  
  6.     return str(max(sum1, sum2)) + str(min(sum1, sum2))
  7.  
  8.  
  9. for i in range(1000, 10000):
  10.     if alg(i) == "1311":
  11.         print(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement