read *,n nr=0 do i=1,n x=rand() y=rand() if ((x*x+y*y).le.1)then nr=nr+1 endif enddo print*,4.*nr/n stop end