Leetcode 簡單17 x的平方根

x的平方根: PHP 24ms: 牛頓迭代法,公式爲(n + x/n)/2 class Solution { /** * @param Integer $x * @return Integer */ function mySqrt($x) { $n = 1; while(!(pow($n,2) <= $x && pow
相關文章
相關標籤/搜索