def judgeSquareSum(c):
'''
题目中是两个整数的平方和用双指针
如果是未知个数怎么求
'''
import math
if c < 0:
return False
r = int(math.sqrt(c))
l = 0
while l <= r :
p = l * l + r * r
if p == c:
print(0)
return True
if p < c:
l += 1
elif p > c:
r -= 1
return False
c = 3
judgeSquareSum(c)