?? d13r11.cpp
字號(hào):
#include "iostream.h"
#include "stdlib.h"
#include "math.h"
void main()
{
//program d13r11
//driver for routine kstwo
int j,n1 = 2000;
int n2 = 1000;
double d,prob,var,factr,eps = 0.1;
double data1[2001], data2[1001];
long idum = -1357;
for (j = 1; j<=n1; j++)
{
data1[j] = gasdev(idum);
}
cout<<endl;
cout<<"Variance ratio K-S statistic Probability"<<endl;
cout.setf(ios::fixed|ios::left);
cout.precision(4);
idum = -2468;
for (int i = 1; i<=11; i++)
{
var = 1.0 + (i - 1) * eps;
factr = sqrt(var);
for (j = 1; j<=n2; j++)
{
data2[j] = factr * gasdev(idum);
}
kstwo(data1, n1, data2, n2, d, prob);
cout<<" ";
cout.width(16);
cout<<var;
cout.width(16);
cout<<d;
cout.unsetf(ios::fixed);
cout.setf(ios::scientific);
cout<<prob<<endl;
cout.unsetf(ios::scientific);
cout.setf(ios::fixed);
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -