?? d13r10.cpp
字號:
#include "iostream.h"
#include "stdlib.h"
#include "math.h"
double func(double x)
{
double y;
y = x / sqrt(2.0);
return erf(y);
}
void main()
{
//program d13r10
//driver for routine ksone
int i,j,npts = 1000;
double var,factr,d,prob,eps = 0.1;
double data[1001];
long idum = -5;
cout<<endl;
cout<<"Variance ratio K-S statistic Probability"<<endl;
cout.setf(ios::fixed|ios::left);
cout.precision(4);
for (i = 1; i<=11; i++)
{
var = 1.0 + (i - 1) * eps;
factr = sqrt(var);
for (j = 1; j<=npts; j++)
{
data[j] = factr * fabs(gasdev(idum));
}
ksone(data, npts, d, prob);
cout<<" ";
cout.width(14);
cout<<var;
cout.width(14);
cout<<d;
cout.width(14);
cout.unsetf(ios::fixed);
cout.setf(ios::scientific);
cout<<prob<<endl;
cout.unsetf(ios::scientific);
cout.setf(ios::fixed);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -