1、题目
https://leetcode-cn.com/problems/sum-of-square-numbers/
2、题意
题解1:枚举<=sqrt©的数,第二个数乘积等于c-i*i;
class Solution {
public:
bool judgeSquareSum(int c) {
int t = sqrt(c);
for(int i=t;i>=0;i--)
{
int j = c-i*i;
if((int)sqrt(j)*(int)sqrt(j)==j)
return true;
}
return false;
}
};