import java.util.Arrays;
public class Solution {
public static int[][] result = new int[2][];
public static int[] array = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
public static int valueStart = 10;
public static int valueEnd = 13;
public static void main(String[] args) {
int firstPart = array.length % 2 == 0 ? array.length / 2 : array.length / 2 + 1;
result[0] = Arrays.copyOfRange(array, 0, firstPart);
result[1] = Arrays.copyOfRange(array, firstPart, array.length);
System.out.println(Arrays.deepToString(result));
}
}
int firstPart = array.length % 2 == 0 ? array.length / 2 : array.length / 2 + 1; что означает строчка ?
maks_top4ik_1337
13 уровень
Значение строчки
Обсуждается
Комментарии (1)
- популярные
- новые
- старые
Для того, чтобы оставить комментарий Вы должны авторизоваться
Стас ПасинковSoftware Developer в ZipyMaster
25 августа 2022, 22:49
тернарный оператор
0