- #include <iostream>
- #include <algorithm>
- using namespace std;
- void swap(int& m, int& n)
- {
- int temp = m;
- m = n;
- n = temp;
- }
- void SortOdd(int a[],int len)
- int begin = 0;
- int end = len -1;
- while(begin < end){
- while(numel[begin]%2 == 1 && end > begin){
- ++begin;
- }
- while(numel[end]%2 == 0 && end > begin){
- --end;
- }
- swap(numel[begin], numel[end]);
- }
- for(int i =0; i<len; ++i){
- cout << a[i] << " ";
- }
- cout << endl;
- return 0;
- }