rqnoj-479

来源:互联网 发布:二次安防用哪个网络 编辑:程序博客网 时间:2024/05/29 15:13
#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(){    double x,x1,x2;    int i,s;    scanf("%lf%lf%lf%lf",&a,&b,&c,&d);    x=-100;    x1=f(x);    x2=f(x+0.01);    s=0;    while(s<3)    {        if(x1*x2<=0)        {            printf("%.2lf ",x+0.01);            s++;        }        x=x+0.01;        x1=x2;        x2=f(x+0.01);    }    return 0;}

原创粉丝点击