结果正确,但不知道为什么一下子出现了四个WA,求教
查看原帖
结果正确,但不知道为什么一下子出现了四个WA,求教
465656
TJUT_0021楼主2021/1/9 14:43
#include<iostream>
#include <iomanip>
using namespace std;
int main()
{
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	cout<<'\n';
		double m,e;
		for(m=-100;m<=100;m+=0.001)
		{
		e=m+0.001;
	 if((a*m*m*m+b*m*m+c*m+d)*(a*e*e*e+b*e*e+c*e+d)<=0)
	 {
     	cout<<fixed;
     	cout<<setprecision(2)<<m<<" ";
		}
	}
	cout<<endl;
	return 0;
	
}
2021/1/9 14:43
加载中...