当前位置:淘百问>百科问答>C++ 用函数 迭代法 求x=均示困方婷效应宽余根号a

C++ 用函数 迭代法 求x=均示困方婷效应宽余根号a

2024-04-18 09:18:09 编辑:join 浏览量:548

问题补充说明:#include #include double diedai(double m,double a); static double n; void main() { double a; cin>>a; cout<1e-7) di... #include#includedouble diedai(double m,double a);static double n;void main(){ double a; cin>>a; cout<1e-7) diedai(n,a); return n;}哪儿错了 展开

C++ 用函数 迭代法 求x=均示困方婷效应宽余根号a

1234567891011121314151617#include<io360问答stream.h>#include<math.h>dou知士雨故机村重温钟理ble diedai(double m,double a);static d怕考多州手掉境批委ouble n;void main(){    double a;    cin>>a;    cout<<diedai(a,a)<<endl;}double diedai(double m,double a){    n=1.0/2者只失次械照须亮刑频*(m+a/m); //1/2=0          1.0/2=0.5    if(fabs(m-n)>1e-7)        diedai(n,a);    return n;}

标签:根号,迭代法,C++

版权声明:文章由 淘百问 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.taobaiwen.com/answer/419376.html
热门文章