Java 代码
class Solution
{
public void reOrderArray(int [] array)
{
int i = 0;
int j = array.length - 1;
while (i < j)
{
while (array[i] % 2 == 1)
i += 1;
while (array[j] %2 == 0)
j -= 1;
if (i < j)
{
int temp = array[i];
array[i] = array[j];
array[j] = temp;
i += 1;
j -= 1;
}
}
}
}