50求救!
查看原帖
50求救!
364902
_qs1_as232楼主2024/12/13 19:14
#include <bits/stdc++.h>
using namespace std;
double a,b,c,d,r=-200,tmp,x[3]={-113524};
int ct;
bool is;
double m(double x){
	double fx=a*x*x*x+b*x*x+c*x+d,k=3*a*x*x+2*b*x+c;
	double b=fx-k*x;
	return 0-(b/k);
}
int main(){
	cin>>a>>b>>c>>d;
	while(r<200){
		is=1;
		tmp=r;
		for(int i=0;i<100;i++){
			r=m(r);
		}
		for(int j=0;j<3;j++){
			if(int(r)==int(x[j])){
				is=0;
			}
		}
		if(is==1){
			x[ct]=r;
			ct++;
		}
		r=tmp;
		r++;
	}
	sort(x,x+3);
	for(int p=0;p<3;p++){
		printf("%.2f ",x[p]);
	}
	return 0;
}
2024/12/13 19:14
加载中...