A quick look on whats wrong here ?
OUTput is correct except for "each value on a new line"
QUESTION: How to guide an array to print elements on a new line? its just randomly happens task to task. lol
google solutions " list.forEach(System.out::println); " and " for (String element : list) {
System.out.println(element);" doesnt work OR i use them wrong way.
wanna fix this(i feel its a small mistake haha) and not using copyOfRange
thank you
package com.codegym.task.task07.task0705;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
/*
One large array and two small ones
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int[] bigBoy = new int [20];
int n = bigBoy.length;
int[] snip = new int[(n / 2)];
int[] shorty = new int[n - snip.length];
for (int i = 0; i < n; i++)
{
if (i < snip.length) {
snip[i] = Integer.parseInt(reader.readLine());
}
else {
shorty[i - snip.length] = Integer.parseInt(reader.readLine());
}
}
System.out.println(Arrays.toString(shorty));
}
}