import math def func(n): total = 0 r = int(math.sqrt(n)) if r ** 2 == n: total += 4 last = r else: last = r + 1 for i in range(1, last): j = math.sqrt(n - i ** 2) if int(j) == j: total += 4 return total n = int(input()) print (func(n))
python 网易笔试编程题(优雅的点)
最新推荐文章于 2024-01-01 11:28:15 发布