把數組中的奇數放到偶數之前

案例 數組內容:3 4 4 6 8 2 1 1 1 調換奇偶:3 1 1 1 8 2 4 4 6   思路 源於快速排序 方式1 參考代碼 #include <iostream> #include <cstring> using namespace std; bool IsOdd(int num) { return num % 2 == 1 ? true : false; } bool
相關文章
相關標籤/搜索