Problem1548--数列轮换2 (课程C)

1548: 数列轮换2 (课程C)

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

我们已经知道A和B 两个变量的交换方法有一种是:
用临时变量轮换:temp = A; A=B; B=temp;
  temp
  ^   \
 /      \
/         v
A<--------B

现在有N个数的数列,要求使用类似算法轮换。即每个数都向前移动一位(第1个数移动到最后一位),例如:N=3
原数列                   5  8  4
temp = a[0];
a[0]=a[1];              8  8  4
a[1]=a[2];              8  4  4
a[2]=temp;            8  4  5

请使用这种方法编程求出新的数列。

Input

第一行1个正整数:N,范围在[1,100]。
第二行N个正整数:范围在[1,10000]。

Output

一行,N个整数。

Sample Input Copy

4
3 4 1 2

Sample Output Copy

4 1 2 3

Source/Category