心如止水
Je n'ai pas le temps
posts - 400,comments - 130,trackbacks - 0
枚举的规模并不大,因此直接枚举即可。
以下是我的代码:
#include<stdio.h>
double a,b,c,d;
double f(double x)
{
    
return a*x*x*x+b*x*x+c*x+d;
}

int main()
{
    scanf(
"%lf%lf%lf%lf",&a,&b,&c,&d);
    
double i;
    
for(i=-100;i<=100;i+=0.01)
      
if(f(i)>=-0.0000001&&f(i)<=0.0000001)
        printf(
"%.2lf ",i);
// getchar();getchar();
return 0;
}

posted on 2010-01-06 20:32 lee1r 阅读(179) 评论(0)  编辑 收藏 引用 所属分类: 题目分类:搜索

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理