Problem1030--移动零

1030: 移动零

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

Description

给定一个数组,将数组内的所有的0移动到他的末尾,同时保持非零元素的相对顺序。

Input

输入一个n表示数组长度,接着输入n个整数。(n <= 100000)

Output

输出n个整数,每个整数后面有一个空格,输出占一行。

Sample Input Copy

5 0 1 0 3 12

Sample Output Copy

1 3 12 0 0 

Source/Category

admin