标签:src ima enter import ret mamicode math else def
import math
def f(n):
if isinstance(n,int):
for i in range(round(math.sqrt(n))):
for j in range(round(math.sqrt(n))):
for k in range(round(math.sqrt(n))):
h = math.sqrt(n - i*i - j*j - k*k)
# 剪掉使用了的值
if h == int(h):
print("(%d,%d,%d,%d)"%(i,j,k,h))
return
else:
print("(0,0,0,0)")
f(5)
f(12)
f("aaa")
2020-05-22
标签:src ima enter import ret mamicode math else def
原文地址:https://www.cnblogs.com/hany-postq473111315/p/12940256.html