mfgnik

Untitled

Apr 24th, 2020
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 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.         found = [True]
  7.         rec(found)
  8.         if n ** 0.5 == int(n ** 0.5):
  9.             print(n, end=' ')
  10.         return True
  11.     return found[0]
  12.  
  13.  
  14. if not rec():
  15.     print(0)
Advertisement
Add Comment
Please, Sign In to add comment