Ниже показано, что у меня есть на данный момент, и я постоянно получаю следующую ошибку:
Код: Выделить всё
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
at Test.main(Test.java:12)
Код: Выделить всё
public class Test {
public static void main(String[] args) {
int count = Integer.parseInt(args[0]);
int[] array = new int[count];
int low = 0;
int high = 0;
for (int i = 0; i < count; i++) {
array[i] = Integer.parseInt(args[i + 1]);
if (array[i] >= 1 && array[i] 50 && array[i]
Подробнее здесь: [url]https://stackoverflow.com/questions/78686656/how-to-count-randomly-generated-numbers-in-a-range[/url]
Мобильная версия