Problems
Swap the neighbours
Swap the neighbours
Given array of n integers. Swap the neighbouring elements of array (a0
with a1
,a2
with a3
and so on). If there are odd number of elements, leave the last element of its place.
Входные данные
First line contains number n. Next line contains n integers. All numbers do not exceed 100 by absolute value.
Выходные данные
Print the updated array.
Input example #1
7 3 5 -7 7 5 -9 -4
Output example #1
5 3 7 -7 -9 5 -4