Given a positive integer num, write a function which returns True if num is a perfect square else False.
Note: Do not use any built-in library function such as
sqrt
.
給予正整數 num ,寫一個函式回傳 num 是否為完美平方數。
提示:不要使用任何內建函式庫的函式,例如
sqrt
。
sqrt
,那就自己實作一個就好了。
sqrt
的方法。LeetCode
C++