文章

246

粉丝

0

获赞

1171

访问

55.6k

头像
迭代求立方根 题解:
P1379 北京航空航天大学机试题
发布于2026年3月14日 18:33
阅读数 112

#include<iostream>
using namespace std;

double x;
int n;

int main()
{
    while(cin>>x>>n)
    {
        double y=x;
        while(n--)
            y=y*2/3+x/(3*y*y);
        printf("%.6f\n",y);
    }
    return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发