牛顿迭代法#include #include int main(){ float x=1,x1; while(1) { x1=x-(sin(x)-0.5*x*x)/(cos(x)-x); cout< if(x1-x<0.00001 && x1-x>-0.00001) break; x=x1; } return 0;}结果:1.742821.46411.407031.404421.40441