#include <iostream>
#include <vector>
using namespace std;
void bubbleSort(vector<int> &a_){
vector<int> t;
int n = a_.size();
for(int i = 0; i < n; i++)
for(int j = 0; j < n - i - 1; j++)
if(a_[j] > a_[j + 1])
swap(a_[j], a_[j + 1]);
for(auto &i: a_) if(i & 1) t.push_back(i);
a_ = t;
}
void solve(){
vector<int> a = {2, 10, 5, 3, 11, 9, 12};
bubbleSort(a);
cout << "a = {";
for(int i = 0; i < a.size() - 1; i++)
cout << a[i] << ", ";
cout << a.back() << "}";
int main(){
solve();
#include <iostream>
#include <vector>
using namespace std;
void bubbleSort(vector<int> &a_){
vector<int> t;
int n = a_.size();
for(int i = 0; i < n; i++)
for(int j = 0; j < n - i - 1; j++)
if(a_[j] > a_[j + 1])
swap(a_[j], a_[j + 1]);
for(auto &i: a_) if(i & 1) t.push_back(i);
a_ = t;
}
void solve(){
vector<int> a = {2, 10, 5, 3, 11, 9, 12};
bubbleSort(a);
cout << "a = {";
for(int i = 0; i < a.size() - 1; i++)
cout << a[i] << ", ";
cout << a.back() << "}";
}
int main(){
solve();
}