package com.company; import java.util.Random; public class Main { public static void main(String[] args) { int[] tab = new int[40]; Random random = new Random(); for (int i = 0; i<40; i++) { if (i <= 10) { tab[i] = random.nextInt(5)+1; } else if (i <= 20) { tab[i] = random.nextInt(4)+6; } else if (i <= 30) { tab[i] = random.nextInt(44)+11; } else { tab[i] = random.nextInt(15)+60; } } for (int i = 0; i<40; i++) { System.out.println(i + ": " + tab[i]); } } }