⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simpson.c

📁 自己做的常用库和实现的数据结构。public domain.
💻 C
字号:
#define N 10
#include  <stdio.h>
#include <math.h>
double f(x)
double x;
{double y;y=exp(x);
 return y;}
double simpson(a,b)
float a,b;
{double h,x,s;
 s=f(a)-f(b);
 h=(b-a)/10; x=a;

 do{x=x+h/2;s=s+4*f(x);
    x=x+h/2;s=s+2*f(x);}
 while(x<b);
 s=s*h/6;
 return(s);}

main()
{float a,b,s;
 scanf("%f,%f",&a,&b);
 s=simpson(a,b);
 printf("%16.12f\n",s);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -