#K85547. Array Right Shift
Array Right Shift
Array Right Shift
Given an integer ( n ) and an array of ( n ) integers, you are required to shift the elements of the array to the right by one position. The element at the end of the array should become the first element, and each of the remaining elements moves one position to the right. This is equivalent to performing a cyclic rotation of the array by one position.
inputFormat
The first line contains a single integer ( n ), which represents the size of the array. The second line contains ( n ) space-separated integers denoting the elements of the array.
outputFormat
Output a single line containing ( n ) space-separated integers representing the shifted array.## sample
5
1 2 3 4 5
5 1 2 3 4
</p>