vector<int> sortArrayByParity(vector<int>& A) { vector<int> EVEN;//偶数 vector<int> ODD;//奇数 for (auto a : A) { if (a % 2 == 0)//EVEN { EVEN.push_back(a); } else//ODD { ODD.push_back(a); } } for (auto o : ODD) { EVEN.push_back(o); } return EVEN; }