C语言常用算法集合.pdfVIP

  • 2
  • 0
  • 约2.19万字
  • 约 10页
  • 2021-11-05 发布于江苏
  • 举报
定积分近似计算: 1.定积分近似计算: 1. /* */  /*梯形法*/  梯形法 double integral(double a,double b,long n)  double integral(double a,double b,long n)  { long i;double s,h,x;  { long i;double s,h,x;  h (b-a)/n;  h (b-a)/n;  s h*(f(a)+f(b))/2;  s h*(f(a)+f(b))/2;  x a;  x a;  for(i 1;in;i++){  for(i 1;in;i++){  x+ h;  x+ h;  s+ h*f(x) ;  s+ h*f(x) ;  }  }  return(s);  return(s);  }  }  /* */  /*矩形法*/  矩形法 double integral(double a,double b,long 

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档