标签:auto 奇数 == vector col lse else ack code
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; }
标签:auto 奇数 == vector col lse else ack code
原文地址:https://www.cnblogs.com/asenyang/p/9712360.html