C++ 代码
class Solution {
public:
void reOrderArray(vector<int> &array) {
vector<int> a,b,c;
for(int x:array){
if(x%2==1) a.push_back(x);
else if(x%2==0) b.push_back(x);
}
c.insert(c.end(),a.begin(),a.end());
c.insert(c.end(),b.begin(),b.end());
array.clear();
array.insert(array.end(),c.begin(),c.end());
}
};