`#include
#include
#include
using namespace std;
double func1(double x)
{
double r=1+x;
return r;
}
double func2(double x)
{
double r=x*2+3;
return r;
}
double func3(double x)
{
double r=1+exp(x);
return r;
}
double func4(double x)
{
double r=pow((1+x),2);
return r;
}
double func5(double x)
{
double r=pow(x,3);
return r;
}
int main()
{
double a,b;
cout<<“input:”;
cin>>a>>b;
double temp=0;
double jd=10000;
double fd=(a+b)/jd;
double func5(double x);//
double(*p)(double);//
p=func5;//
for(double i=a;i<=b;i+=fd)
{
temp=p(i)*fd+temp;//
}
cout<<"result="<<temp<<endl;
return 0;
}
`