Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
136871 | 梁乃元 | 解一元三次方程 | C++ | 解答错误 | 0 | 0 MS | 244 KB | 432 | 2024-03-09 15:53:42 |
# include <bits/stdc++.h> using namespace std ; double a , b , c , d , cnt ; long double ans ( int x ) { return a * x * x * x + b * x * x + c * x + d ; } int main ( ) { cin >> a >> b >> c >> d ; for ( double i = -100 ; i <= 100 ; i += 0.01 ) { if ( cnt == 3 ) { break ; } if ( ans ( i ) == 0 ) { cout << fixed << setprecision ( 2 ) << i << ' ' ; cnt ++ ; i ++ ; } } return 0 ; }