Move all zeros in the array to the end while keeping the relative order of the non-zero elements.
Input: one line of space-separated integers. Output: the rearranged array, space-separated.
Your program reads from stdin and prints to stdout.
Example 1
Input: 0 1 0 3 12
Output: 1 3 12 0 0
Hints