Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- long producedureDirectPi(int N)
- {
- long nHits = 0;
- long x = 0;
- long y = 0;
- for(i = 0, i < N, i++)
- {
- x = metodoRan (1, -1);
- y = metodoRan (1, -1);
- if ( (x*x) + (y*y) ) < 1)
- {
- nHits = nHits++;
- }
- }
- return nHits;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement