Sqrt(x)

时间:2015-04-18 11:28:43   收藏:0   阅读:104

Implement int sqrt(int x).

Compute and return the square root of x.

 

1 class Solution {
2 public:
3     int mySqrt(int x) {
4         return floor(sqrt(x*1.00));
5     }
6 };

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!