用二分法求方程2x^3-4x^2+3x-6=0的根,要求误差小于10^(-5),用c语言中的函数求

[复制链接]
查看11 | 回复2 | 2011-4-14 18:15:13 | 显示全部楼层 |阅读模式
#include#includedouble f(double d){return 2*pow(d,3)-4*d*d+3*d-6; }void main(){ int k=0;double a,b,limit;printf("\nplease input the 区间:"); scanf(""%lf %lf",&a,&b);printf("\nplease input the 解的精确程度:"); scanf("%lf",&limit);if(f(a)*f(b)>0)
printf("\n 无法用二分法求解"); else
回复

使用道具 举报

千问 | 2011-4-14 18:15:13 | 显示全部楼层
#include#include double f(double x){return 2*x*x*x-4*x*x+3*x-6;}double key(double a, double b,double l){ if(f(a)*f(b)>0)printf("方程在该区域无解。");else wh
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行