提交时间:2024-03-09 15:53:42

运行 ID: 136871

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