Facebook
From Adrian Pietrzak, 5 Years ago, written in Java.
Embed
Download Paste or View Raw
Hits: 233
  1. package com.company;
  2. import java.util.Random;
  3.  
  4. public class Main {
  5.  
  6.     public static void main(String[] args) {
  7.  
  8.         int[] tab = new int[40];
  9.         Random random = new Random();
  10.  
  11.         for (int i = 0; i<40; i++) {
  12.             if (i <= 10) {
  13.                 tab[i] = random.nextInt(5)+1;
  14.             } else if (i <= 20) {
  15.                 tab[i] = random.nextInt(4)+6;
  16.             } else if (i <= 30) {
  17.                 tab[i] = random.nextInt(44)+11;
  18.             } else {
  19.                 tab[i] = random.nextInt(15)+60;
  20.             }
  21.         }
  22.  
  23.         for (int i = 0; i<40; i++) {
  24.             System.out.println(i + ": " + tab[i]);
  25.         }
  26.  
  27.     }
  28. }
  29.