Sub Calc()# O# \! E2 b- O2 z1 l- Z% N
Dim c As Long, j As Long, k As Long, p As Single
! [$ j5 {# l) N0 F D$ m( b4 t. m Dim a As Single
, ]+ j& J9 `' c Dim b As Single
5 e& J! P& E* u3 ~& y# A: K3 d: Y
4 E# i. {8 h* c$ |/ E% {/ j c = Val(InputBox("")) 'If c is large enough...
/ P1 e" t; |: S/ g s
$ B5 f. |- s6 J7 u! H For j = 1 To c% q0 Y: m( k0 ~
a = Rnd
1 @/ P; }: N* z+ s) p& } b = Rnd2 A+ H" A) B8 f: }
If a ^ 2 + b ^ 2 <= 1 Then k = k + 10 D5 B4 ?7 b1 Z, a6 N0 w
Next j
3 U& B) B* e1 U- D, X
4 t% m$ A M0 o p = k / j * 4 'What p is...1 E! y2 O# ?& m* L. `
End Sub |