daily pastebin goal
2%
SHARE
TWEET

Untitled

a guest Jun 25th, 2018 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.         Scanner scanner = new Scanner(System.in);
  3.  
  4.         ArrayList<Integer> lista = new ArrayList<>();
  5.  
  6.  
  7.         Random generator = new Random();
  8.  
  9.  
  10.  
  11.        int ileLiczb = scanner.nextInt();
  12.  
  13.         for(int i=0; i<ileLiczb; i++){
  14.  
  15.             lista.add(generator.nextInt(200)-100);
  16.         }
  17.  
  18.         int suma = 0;
  19.         for(Integer i: lista){
  20.              suma = suma + i;
  21.             System.out.println(suma);
  22.         }
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