标签:数组 奇偶校验 span sort 校验 array ret one auto
1 class Solution 2 { 3 public: 4 vector<int> sortArrayByParity(vector<int>& A) 5 { 6 vector<int> result_one; 7 vector<int> result_two; 8 for(auto d:A) 9 { 10 if(d&0x1) 11 result_two.push_back(d); 12 else 13 result_one.push_back(d); 14 } 15 vector<int> result; 16 for(auto d:result_one) 17 result.push_back(d); 18 for(auto d:result_two) 19 result.push_back(d); 20 return result; 21 } 22 };
标签:数组 奇偶校验 span sort 校验 array ret one auto
原文地址:https://www.cnblogs.com/Asurudo/p/9655574.html