>>557
#include <stdio.h>
#define LAMBDA 843314861L
#define RANCONST 453816693L
#define RANDOM_INIT_VALUE 198313L
#define RAN2_32 4294967296.0
#define LOOPCOUNT 100000
#define LOOPSTEP 10000
int main(){
int i, CircleCount=0;
float x, y, z, random(void);
for (i = 1; i <= LOOPCOUNT; i++) {
x = random(); y = random(); z = random();
if (x + y + z <= 1.0)CircleCount++;
if (i % LOOPSTEP == 0)printf("%7d times V=%f\n", i, CircleCount / (float)i);
}
return 0;
}

float random(){
static unsigned long x = RANDOM_INIT_VALUE;
x = LAMBDA * x + RANCONST;
return (float)x / RAN2_32;
}