class Solution:
def square(self , c: int) -> bool:
n = int(pow(c,0.5))
for i in range(n,n//2,-1):
nva = c - i**2
if nva == 0:
continue
y = pow(nva,0.5)%1
if y == 0:
return True
return False
class Solution:
def square(self , c: int) -> bool:
# write code here
s = int(c**0.5)
for i in range(1, s+1):
# 整数
if int((c-i**2)**0.5) == (c-i**2)**0.5:
return True if c != 1 else False
return False
class Solution:
def square(self , c: int) -> bool:
# write code here
if c==1:
return False
for a in range(1,int(c**0.5)+1):
b = c - a**2
# 检查b是否为平方数
if b**0.5 == int(b**0.5):
return True
return False