LeetCode x 的平方根(Sqrt(x))

題目web 實現 int sqrt(int x) 函數。svg 計算並返回 x 的平方根,其中 x 是非負整數。函數 因爲返回類型是整數,結果只保留整數的部分,小數部分將被捨去。spa 示例 輸入: 4 輸出: 2code 思路 利用math自帶 函數xml public int mySqrt(int x) { return (int)Math.sqrt(x); }
相關文章
相關標籤/搜索