1450: 奇数优先
Memory Limit:128 MB
Time Limit:2.000 S
Judge Style:Text Compare
Creator:
Submit:54
Solved:32
Description
给定一组整数,所有数均是正整数,把所有值是奇数的点排在前面,偶数节点排在后面,且每个数字的前后顺序不变。例如,原链表有三个数1,2,3,调整以后,为1,3,2,而不能是3,1,2。因为在原链表当中,1在3的前面。
Input
输入为空格分隔的一行整数,以-1结尾。
Output
输出奇数在前偶数在后的整数序列,保持输入的顺序。
Sample Input Copy
1 2 3 4 5 6 7 8 9 11 13 -1
Sample Output Copy
1 3 5 7 9 11 13 2 4 6 8
HINT
n范围1<=n<=5000000