P1024
#include<bits/stdc++.h>
using namespace std;
double a,b,c,d;
double f(double x) {
return a * x * x * x + b * x * x + c * x + d;
}
int main(){
cin >> a >> b >> c >> d;
for (int i = -10000;i <= 10000;i ++) {
double j = i * 1.00 / 100.00;
if (f(j) == 0) printf("%.2lf ",j);
}
return 0;
}
感觉这个好奇怪,写了一句(样例2测试)
cout << 1.00 - 4.65 + 2.25 + 1.4 << endl
输出了-4.44089e-16