s <-100000x <-runif(s)y <-runif(s)sum(x^2+y^2<=1)*4/s
Standard input is empty
[1] 3.13468
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!