题目: 求解立方根
- 热度指数:1008 时间限制:1秒 空间限制:32768K
题目描述
•计算一个数字的立方根,不使用库函数
立方根的逼近迭代方程是 y(n+1) = y(n)2/3 + x/(3y(n)*y(n)),其中y0=x. 求给定的x经过n次迭代后立方根的值。
详细描述:
•接口说明
原型:
public static double getCubeRoot(double input)
输入:double 待求解参数
返回值:double 输入参数的立方根
输入描述:
输出描述:
输入例子:
输出例子:
在线提交网址: http://www.nowcoder.com/practice/caf35ae421194a1090c22fe223357dca?tpId=37&tqId=21330&rp=&ru=/ta/huawei&qru=/ta/huawei/question-ranking
已AC代码:
相关链接: http://blog.csdn.net/lzuacm/article/details/51335995 http://ilovers.sinaapp.com/article/迭代法求平方根和立方根 http://blog.csdn.net/never_cxb/article/details/47734519
文档信息
- 本文作者:极客中心
- 本文链接:https://blog.geekzl.com/get-cube-root.html
- 版权声明:自由转载-非商用-非衍生-保持署名(创意共享3.0许可证)
Related Issues not found
Please contact @yanglr to initialize the comment