题目描述:
AC代码:
#include<iostream>
using namespace std;
double a,b,c,d;
int ans = 0;
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);
for(double i=-100.00;i<=100.00;i+=0.001)
{
double l = i,r = i + 0.001;
if(f(l) * f(r) < 0)
{
printf("%.2lf ",l);
ans++;
}
if(ans == 3) break;
}
return 0;
}