x不是整数的时候,代码怎么写?
#include<bits/stdc++.h> using namespace std; double a,b,c,d; double x; int main(){ cin>>a>>b>>c>>d; for(x=-100;x<=100;x++) if((a*x*x*x+b*x*x+c*x+d)==0) cout<<fixed<<setprecision(2)<<x<<" "; return 0; }