Код: Выделить всё
public class Test {
public static void main(String[] args) {
// counts generated integers
int count = Integer.parseInt(args[0]);
// creates an array of integers
int[] array = new int[count];
// starts the low and high values counting up from 0 by 1's
int low = 0;
int high = 0;
// counts the numbers between 1 and 50
for (int i = 0; i = 1 && array[i] 50 && array[i]
Подробнее здесь: [url]https://stackoverflow.com/questions/78686656/how-to-count-randomly-generated-numbers-in-a-range[/url]