package ru.job4j.array;

/**
*Inverting an array. Task 5.0.
*@author Dmitriy Bobrov (mailto:bobrov.dmitriy@gmail.com)
*@since 0.1
*/
public class Turn {
/**
*Class Turn. inverting array.
*/

/**
*inverting array.
*@param array - input array.
*@return array - return iverting array.
*/

	public int[] back(int[] array) {
		if (array.length % 2 == 0) {
			for (int i = 0; i < array.length / 2; i++) {
				int tmp = array[i];
				array[i] = array[array.length - i - 1];
				array[array.length - i - 1] = tmp;
			}
			return array;
		} else {
			for (int i = 0; i <= array.length / 2; i++) {
				int tmp = array[i];
				array[i] = array[array.length - i - 1];
				array[array.length - i - 1] = tmp;
			}
		}
		return array;
	}
}
@@ -317,40 +317,8 @@
 ) %7B%0A
-%09%09if (array.length %25 2 == 0) %7B%0A%09
 %09%09fo
@@ -493,200 +493,8 @@
 ay;%0A
-%09%09%7D else %7B%0A%09%09%09for (int i = 0; i %3C= array.length / 2; i++) %7B%0A%09%09%09%09int tmp = array%5Bi%5D;%0A%09%09%09%09array%5Bi%5D = array%5Barray.length - i - 1%5D;%0A%09%09%09%09array%5Barray.length - i - 1%5D = tmp;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return array;%0A
 %09%7D%0A%7D

Task 5.0 inverting array