| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 80412 | sh25_wangtaojie | 一元三次方程求解 | C++ | 通过 | 2 MS | 256 KB | 306 | 2026-01-04 15:16:04 |
#include<bits/stdc++.h> using namespace std; double a,b,c,d; const double dx=0.001; double f(double x){ return a*x*x*x+b*x*x+c*x+d; } int main(){ cin >> a >> b >> c >> d; double l=-200, r=+200; for(double x=l;x<=r;x+=dx){ if(f(x)*f(x+dx)<=0) printf("%.2f ",x); } return 0; }