#include #include #include #include double r[1000]; double o[10]; double chi=0; main(){ double c; ofstream fout; fout.open("random.data"); for(int i = 0;i<100;i++) o[i]=0; for(int j =0;j<1000;j++) { c = -2*log((double)(1+rand()%100)/100); o[int(c)]++; }; for(int j = 0;j<10; j++) cout << o[j] << endl; }