public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader= new BufferedReader(new InputStreamReader(System.in));
int[] bigArray=new int[20];
int[] smallArray1=new int[10];
int[] smallArray2=new int[10];
for (int i=0;i<20;i++){
bigArray[i]=Integer.parseInt(reader.readLine());
if(i<10) smallArray1[i]=bigArray[i];
else smallArray2[i-10]=bigArray[i];
System.out.println(smallArray2[i-10]);
}
}
}
package com.codegym.task.task07.task0705;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
One large array and two small ones
1. Create an array of 20 numbers.
2. Populate it with values from the keyboard.
3. Create two arrays of 10 numbers each.
4. Copy the large array into the two small ones: half the numbers into the first small array, and the second half into the second small array.
5. Display the second small array, each value on a new line.
*/
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader= new BufferedReader(new InputStreamReader(System.in));
int[] bigArray=new int[20];
int[] smallArray1=new int[10];
int[] smallArray2=new int[10];
for (int i=0;i<20;i++){
bigArray[i]=Integer.parseInt(reader.readLine());
if(i<10) smallArray1[i]=bigArray[i];
else smallArray2[i-10]=bigArray[i];
System.out.println(smallArray2[i-10]);
}
}
}