//Patriche Robert Cosmin
#include <iostream>
using namespace std;

void separaPariDispari(int matrice[3][3], int righe, int colonne) {
    int pari[9], dispari[9];
    int countPari = 0, countDispari = 0;

    for (int i = 0; i < righe; i++) {
        for (int j = 0; j < colonne; j++) {
            if (matrice[i][j] % 2 == 0) {
                pari[countPari++] = matrice[i][j];
            } else {
                dispari[countDispari++] = matrice[i][j];
            }
        }
    }

    cout << "Numeri pari: ";
    for (int i = 0; i < countPari; i++) {
        cout << pari[i] << " ";
    }
    cout << endl;

    cout << "Numeri dispari: ";
    for (int i = 0; i < countDispari; i++) {
        cout << dispari[i] << " ";
    }
    cout << endl;
}

int main() {
    int matrice[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
    separaPariDispari(matrice, 3, 3);
    return 0;
}
