注册 登录
编程论坛 C++教室

大神帮忙看看这哪里错了

xixiluo 发布于 2014-04-20 22:05, 398 次点击
#include<stdio.h>
#include<math.h>
void main()
{
 double NormDistFunc(double x)
{
  double x=(x>=0?x:-x);
  double a[]={0.0705230784,0.0422820123,0.0092705272,0.0001520143,0.0002765672,0.0000430638};
  double m=0;
  double erf;
  for(int i=1;i<=6;i++)
  {
    m=a[i-1]*Math.Pow(x,i);
  }
  erf=1-Math.Pow(1.0+erf,-16);
  double phi=(x>=0?0.5*(1+erf):0.5*(1-erf));
  return phi;
}
}
1 回复
#2
骚年来一发2014-04-20 23:25
函数可以写在主函数里啊     不知道行不行  我是菜鸟  但是这种形式没见过
1