为什么第二个打印出来是乱码啊
#include <stdio.h>#include <stdlib.h>
#include <math.h>
double jifen(double t,double x,double *p1,double *p2,double *p3)//定义指针函数
{
double f1,f2,f3;
while(x<1)
{
f1+=t*(x*x*x+3*x*x-x+4);
f2+=t*(x*sqrt(1+cos(2*x)));
f3+=t*(1/(1+x*x));
x+=t;
} //进行积分运算
*p1=f1;*p2=f2;*p3=f3;
return x;//返回一个值
}
int main()
{
double t=0.001,x=0,f1=0,f2=0,f3=0,n;
n=jifen(t,x,&f1,&f2,&f3);
printf("\nf(x)=x^3+3x^2-x+4在(0,1)上定积分为%lf\n",f1);
printf("\nf(x)=x*sqrt(1+cos2x)在(0,1)上定积分为%lf\n",f2);
printf("\nf(x)=1/(1+x^2)在(0,1)上定积分为%lf\n",f3);
return 0;
}