阅读背景:

Leetcode两数平方和

来源:互联网 
!-- flowchart 箭头图标 勿删 --
class Solution {
    public boolean judgeSquareSum(int c) {
        int i = 0, j = (int) Math.sqrt(c);
        while (i <= j) {
            if (i * i + j * j == c) {
                return true;
            } else if (i * i + j * j > c) {
                j--;
            } else {
                i++;
            }
        }
        return false;
    }
}
class



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: