#include <stdio.h>
#include <math.h>
float solut(float a,float b,float c,float d){
float x=1,x0,f,f1;
do{
x0=x;
f=((a*x0+b)*x0+c)*x0+d;
f1=(3*a*x0+2*b)*x0+c;
x=x0-f/f1;
}while(fabs(x-x0)>=1e-3);
return x;
}
int main(){
float a,b,c,d;
printf("input a,b,c,d:");
scanf("%f,%f,%f,%f",&a,&b,&c,&d);
printf("x=%10.7f",solut(a,b,c,d));
return 0;
}
04-21
1499
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交