> 数学 >
分别采用梯形法、矩形法和辛普森法计算函数f(x)=e^x在区[-1,1]上的定积分
人气:459 ℃ 时间:2020-04-16 06:24:54
解答
#include
#include
#include
float fx(float x){
return(exp(3.0*x)+pow(x,7));
}
float tixing(float(*fun)(float x),float a,float b,int n)
{
float s,h,y;
int i;
s=(fun(a)+fun(b))/2;
h=(b-a)/n;
for(i=1;i
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版