12581: 颠倒栈(栈和队列)

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:2 Solved:0

Description

题目:用递归颠倒一个栈。例如输入栈{1, 2, 3, 4, 5}1在栈顶。
颠倒之后的栈为{5, 4, 3, 2, 1}5处在栈顶。

Input

输入:

1 2 3 4 5

Output

输出:

5 4 3 2 1

Sample Input Copy

1 2 3 4 5 6

Sample Output Copy

6 5 4 3 2 1