n=10000000 ns=0 do i=1,n xj=rand(0) yj=rand(0) if(yj**2+xj**2.le.1.)then ns=ns+1 endif enddo print *,ns*4./n stop end function f(x) f=x*x return end