Advertisement
stupid_pro

Одна куча кодом

Feb 11th, 2023
722
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. def fourth(s):
  2.     if s + 2 >= 30 or s + 3 >= 30 or s * 2 >= 30:
  3.         return 1
  4.     return 0
  5.  
  6.  
  7. def third(s):
  8.     if s + 2 >= 30 or s + 3 >= 30 or s * 2 >= 30:
  9.         return 0
  10.     return fourth(s + 2) and fourth(s + 3) and fourth(s * 2)
  11.  
  12.  
  13. def second(s):
  14.     if s + 2 >= 30 or s + 3 >= 30 or s * 2 >= 30:
  15.         return 1
  16.     return third(s + 2) or third(s + 3) or third(s * 2)
  17.  
  18.  
  19. def first(s):
  20.     if s + 2 >= 30 or s + 3 >= 30 or s * 2 >= 30:
  21.         return 0
  22.     return second(s + 2) and second(s + 3) and second(s * 2)
  23.  
  24.  
  25. for i in range(30):
  26.     if first(i):
  27.         print(i)
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement