求条!!!
查看原帖
求条!!!
1074115
zhangshengzhe1楼主2024/8/18 14:58
#include<bits/stdc++.h>
using namespace std;
double a,b,c,d;
double f(double x){
	return a*x*x*x+b*x*x+c*x+d; 
}
int main(){
	
	cin>>a>>b>>c>>d;
	int n=0;
	for(double i=-105;i<=105;i+=0.001){
		if(f(i)*f(i+0.001)<=0){
			printf("%.2f",(2+i+0.001)/2);
			n++;
			if(n!=3) cout<<" ";
		}
	}
	return 0;
} 
2024/8/18 14:58
加载中...