Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
136869 梁乃元 解一元三次方程 C++ 解答错误 0 0 MS 248 KB 429 2024-03-09 15:52:41

Tests(0/6):


# include <bits/stdc++.h> using namespace std ; int 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 ; }


测评信息: