@@ -0,0 +1,1074 @@
+import java.util.Scanner;%0A%0Apublic class ExtractMiddleElements %7B%0A    public static void main(String%5B%5D args) %7B%0A        Scanner scanner = new Scanner(System.in);%0A        String%5B%5D input = scanner.nextLine().split(%22 %22);%0A        int%5B%5D numberArray = new int%5Binput.length%5D;%0A%0A        for (int i = 0; i %3C numberArray.length; i++) %7B%0A            numberArray%5Bi%5D = Integer.parseInt(input%5Bi%5D);%0A        %7D%0A%0A        if (numberArray.length == 1) %7B%0A            extractOne(numberArray);%0A        %7D%0A        else if (numberArray.length %25 2 == 0) %7B%0A            extractEven(numberArray);%0A        %7D%0A        else %7B%0A            extractOdd(numberArray);%0A        %7D%0A    %7D%0A%0A    private static void extractOne(final int%5B%5D arr) %7B%0A        System.out.printf(%22%7B %25d %7D%22, arr%5B0%5D);%0A    %7D%0A%0A    private static void extractEven(final int%5B%5D arr) %7B%0A        System.out.printf(%22%7B %25d, %25d %7D%22, arr%5Barr.length / 2 - 1%5D, arr%5Barr.length / 2%5D);%0A    %7D%0A%0A    private static void extractOdd(final int%5B%5D arr) %7B%0A        System.out.printf(%22%7B %25d, %25d, %25d %7D%22, arr%5Barr.length / 2 - 1%5D, arr%5Barr.length / 2%5D, arr%5Barr.length / 2 + 1%5D);%0A    %7D%0A%7D%0A

Create 09.ExtractMiddleElements.java