标签:
#include <stdio.h> #include <math.h> #define tol 0.01 int main() { float a,b,c,d;//实数 scanf("%f%f%f%f",&a,&b,&c,&d); double x; short flag = 0; for(x = -100.0; x <= 100.0; x += tol) { if(fabs(a*x*x*x + b*x*x + c*x + d)< tol) { flag ++; printf("%.2lf ",x); x += (1-tol); } if(flag == 3) break; } printf("\n"); return 0; }
标签:
原文地址:http://www.cnblogs.com/520xiuge/p/5137952.html