```
class Solution {
public:
bool isSq(int v){
return (int)sqrt(v) * (int)sqrt(v) == v;
}
bool judgeSquareSum(int c) {
for(int i=0;i<=sqrt(c);i++){//i从0开始 毕竟c可以为0
if(isSq(c-i*i))
return true;
}
return false;
}
};
```