回复 2楼 rjsp
#include <iostream>
using namespace std;
double f (double x,double a0,double a1=0,double a2=0,double a3=0)
{
return a0+a1*x+a2*x*x+a3*x*x*x;
}
int main()
{
int n;double x,a0,a1,a2,a3,A[4];
cin>>x>>n;
for(int i=1;i<=n+1;i++)
cin>>A[i];
cout<<f(x,a0,a1,a2,a3);
return 0;
}
输出一直是0,怎么破?请教