每日一题ing,今天是个medium题633. Sum of Square Numbers
class Solution {
public:
bool judgeSquareSum(int c) {
long long i=0,j=sqrt(c);
while(i<=j){
long long temp=i*i+j*j;
if(temp==c){
return true;
}
if(temp>c){
j--;
}
else{
i++;
}
}
return false;
}
};