#include "TrueBASIC.h" int main(); int main() { int ibin, n, nbin, nmax, Itmp1_; double delta_x, prob[101], x; for(Itmp1_ = 0; Itmp1_ <= 100; ++Itmp1_) prob[Itmp1_] = 0; nbin = 100; // ” ‚Ì” delta_x = 1.0/nbin; n = 0; // ”½•œ‰ñ” x = 0.6; nmax = 10000; while(n < nmax) { x = 4*x*(1-x); ++n; ibin = (int)(x/delta_x) + 1; ++(prob[ibin]); } for(ibin = 1; ibin <= nbin; ++ibin) { if(prob[ibin] > 0) printf("%12d %12f\n", ibin, prob[ibin]/nmax); } return 0; }