第1,3个测试点AC
#include <bits/stdc++.h>
using namespace std;
double a, b, c, d;
double f(int x) {
return a*x*x*x + b*x*x + c*x + d;
}
int main() {
cin >> a >> b >> c >> d;
cout << fixed << setprecision(2);
for(double i = -100; i < 100; i++) {
if(f(i) == 0)
cout << i << ' ';
}
return 0;
}
就帮帮蒟蒻吧