#include <stdio.h>
void sort_array(int n, int a[]) {
int temp[1000];
int pos = 0;
for (int i = 0; i < n; i++) {
if (a[i] % 2 == 0) {
temp[pos++] = a[i];
}
}
for (int i = 0; i < n; i++) {
if (a[i] % 2 != 0) {
temp[pos++] = a[i];
}
}
for (int i = 0; i < n; i++) {
a[i] = temp[i];
}
}