Advertisement
winone1208

Java zad9

Mar 19th, 2021
662
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.34 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.  
  12.         for (int i = 0; i < 100; i++){
  13.             suma = suma + (random.nextInt(100 / 2)*2) + 2;
  14.         }
  15.  
  16.  
  17.             System.out.println(suma);
  18.  
  19.     }
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement