对于多项式f(x)=ax3+bx2+cx+d 和给定的a, b, c, d, x,计算f(x)的值。
#include<stdio.h>
int main()
{
double x,a,b,c,d,y;
scanf("%lf %lf %lf %lf %lf",&x,&a,&b,&c,&d);
y=a*x*x*x+b*x*x+c*x+d;
printf("%.7f",y);
return 0 ;
}
对于多项式f(x)=ax3+bx2+cx+d 和给定的a, b, c, d, x,计算f(x)的值。
#include<stdio.h>
int main()
{
double x,a,b,c,d,y;
scanf("%lf %lf %lf %lf %lf",&x,&a,&b,&c,&d);
y=a*x*x*x+b*x*x+c*x+d;
printf("%.7f",y);
return 0 ;
}