winone1208

Java zad10

Mar 19th, 2021 (edited)
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.36 KB | None | 0 0
  1. package pl.patrykk;
  2.  
  3. import java.util.Random;
  4.  
  5. public class Main {
  6.  
  7.     public static void main(String[] args) {
  8.         Random random = new Random();
  9.  
  10.         int suma=0;
  11.         int i=0;
  12.  
  13.         do{
  14.             suma = suma + (random.nextInt(100 / 2)*2) + 2;
  15.             i++;
  16.  
  17.         } while (i<100);
  18.  
  19.  
  20.         System.out.println(suma);
  21.  
  22.     }
  23. }
  24.  
Add Comment
Please, Sign In to add comment