#include <iostream>
#include <vector>
using namespace std;
void insertionSort(vector<int> &a_){
vector<int> t;
int n = a_.size();
for(int i = 0; i < n; i++){
int u = i;
for(int j = i + 1; j < n; j++)
if(a_[j] < a_[u])
u = j;
swap(a_[i], a_[u]);
if(!(a_[i] & 1))
t.push_back(a_[i]);
}
a_ = t;
void solve(){
vector<int> a = {-2, 4, 10, -1, 1, 6, 3, 7, 8, 5};
insertionSort(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 insertionSort(vector<int> &a_){
vector<int> t;
int n = a_.size();
for(int i = 0; i < n; i++){
int u = i;
for(int j = i + 1; j < n; j++)
if(a_[j] < a_[u])
u = j;
swap(a_[i], a_[u]);
if(!(a_[i] & 1))
t.push_back(a_[i]);
}
a_ = t;
}
void solve(){
vector<int> a = {-2, 4, 10, -1, 1, 6, 3, 7, 8, 5};
insertionSort(a);
cout << "a = {";
for(int i = 0; i < a.size() - 1; i++)
cout << a[i] << ", ";
cout << a.back() << "}";
}
int main(){
solve();
}