C++中求三次方程的根#include #include #include using namespace std;double f(double); //函数声明 double xpoint(double,double); //函数声明double root(double,double); //函数声明int main( ){ double x1,x2,f1,f2,x;do{coutx1>>x2;f1=f(x1);

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/26 05:57:58

C++中求三次方程的根
#include
#include
#include
using namespace std;
double f(double); //函数声明
double xpoint(double,double); //函数声明
double root(double,double); //函数声明
int main( )
{ double x1,x2,f1,f2,x;
do
{coutx1>>x2;
f1=f(x1);
f2=f(x2);
} while(f1*f2>=0);
x=root(x1,x2);
cout

你的f实现在哪儿了?