mfgnik

Untitled

Apr 24th, 2020
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. def rec(found=None):
  2.     if found is None:
  3.         found = [False]
  4.     n = int(input())
  5.     if n != 0:
  6.         rec(found)
  7.         if n ** 0.5 == int(n ** 0.5):
  8.             found[0] = True
  9.             print(n, end=' ')
  10.         return found[0]
  11.     return found[0]
  12.  
  13.  
  14. if not rec():
  15.     print(0)
Advertisement
Add Comment
Please, Sign In to add comment