亲爱的提问者您好,我们很乐意您能在CSDN解决编程过程中遇到的问题,
但是问答频道谢绝一切直接提问作业、索要代码的行为,在此对您发出正式警告。
后续如果继续不加思考,亲手实践,而是直接提出作业问题,我们会限制您在问答频道的提问权益。
CSDN也鼓励用户通过举报功能来对这些行为进行监督反馈,共建问答频道良好的风气。
#include<iostream>
#include<cmath>
using namespace std;
float niu(float x0);
int main()
{
float x0 = 0.0;
cout<<niu(x0);
return 0;
}
float niu(float x0)
{
float x1;
while (abs(x0*x0 + 3 * x0 - 4) > 0.00005)
{
x1 = x0 - (x0*x0 + 3 * x0 - 4) / (2 * x0 + 3);
x0 = x1;
niu(x0);
}
return x0;
}