50分
查看原帖
50分
1097884
shuhao楼主2024/8/3 19:10

第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;
}

就帮帮蒟蒻吧

2024/8/3 19:10
加载中...