#include
#include
#define N 10000000 /*把1到x分成N份,这是微元法的拆分步骤*/
main()
{
double fun(double);
double x,t,dt,df,sum=0.0;
long j;
printf("input x: ");
scanf("%lf",&x); /*输入时注意x的定义域:t>0,所以输入的t必须大于0*/
dt=(x-1)/N;
for(j=1;j
#include
#include
#define N 10000000 /*把1到x分成N份,这是微元法的拆分步骤*/
main()
{
double fun(double);
double x,t,dt,df,sum=0.0;
long j;
printf("input x: ");
scanf("%lf",&x); /*输入时注意x的定义域:t>0,所以输入的t必须大于0*/
dt=(x-1)/N;
for(j=1;j