/C04009 - Tách chẵn lẻ
<Problem>
https://code.ptit.edu.vn/student/question/C04009#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#define max(i, j) ((i > j) ? i : j)
int main() {
int t;
//scanf("%d", &t);
t = 1;
while (t--) {
int n;
scanf("%d", &n);
int arr[101];
int even[101];
int e = 0;
int odd[101];
int o = 0;
for (int i = 0; i < n; i++) {
scanf("%d", &arr[i]);
if (arr[i] % 2 == 0) even[e++] = arr[i]; else odd[o++] = arr[i];
}
for (int i = 0; i < e; i++) printf("%d ", even[i]);
printf("\n");
for (int i = 0; i < o; i++) printf("%d ", odd[i]);
printf("\n");
}
return 0;
}