Why my code doesn't work?
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader re = new BufferedReader(new InputStreamReader(System.in));
int[] num0 = new int[20];
for(int i=0;i<num0.length;i++)
{
String s = re.readLine();
num0[i] = Integer.parseInt(s);
}
int[] num1 = new int[10];
int[] num2 = new int[10];
for (int m = 0; m < num0.length/2; m++)
num1[m] = num0[m];
for (int r = num0.length/2; r < num0.length; r++)
{
num2[r] = num0[r];
System.out.println(num2[r]);
}
}
}
package com.codegym.task.task07.task0705;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
One large array and two small ones
*/
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader re = new BufferedReader(new InputStreamReader(System.in));
int[] num0 = new int[20];
for(int i=0;i<num0.length;i++)
{
String s = re.readLine();
num0[i] = Integer.parseInt(s);
}
int[] num1 = new int[10];
int[] num2 = new int[10];
for (int m = 0; m < num0.length/2; m++)
num1[m] = num0[m];
for (int r = num0.length/2; r < num0.length; r++)
{
num2[r] = num0[r];
System.out.println(num2[r]);
}
}
}