daily pastebin goal
53%
SHARE
TWEET

Untitled

a guest Sep 20th, 2018 54 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. public class Main {
  2.     public static void main(String[] args) {
  3.         int kolvo = 0;
  4.         double i = 0;
  5.         double pi = 0;
  6.         while (kolvo < 1000) {
  7.             double x = Math.random();
  8.             double y = Math.random();
  9.             System.out.println("Число x = " + x);
  10.             System.out.println("Число y = " + y);
  11.             kolvo++;
  12.             if (x*x + y*y < 1){
  13.                 i++;
  14.                 pi = i/1000 * 4;
  15.             }
  16.             System.out.println("Колличество подходящих точек : " + i);
  17.             System.out.println("Число Пи = " + pi);
  18.         }
  19.     }
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top