16 lines
260 B
Text
16 lines
260 B
Text
fastfunc mc n .
|
|
for i = 1 to n
|
|
x = randomf
|
|
y = randomf
|
|
if x * x + y * y < 1 : hit += 1
|
|
.
|
|
return 4 * hit / n
|
|
.
|
|
numfmt 0 4
|
|
print mc 100
|
|
print mc 1000
|
|
print mc 10000
|
|
print mc 100000
|
|
print mc 1000000
|
|
print mc 10000000
|
|
print mc 100000000
|