/*
Nome: Mario
Cognome: Montanari
*/

#include <iostream>
#include <ctime>
#include <cstdlib>

#define SIZE 10
#define MASSIMO 9
#define MINIMO 0

using namespace std;

typedef struct {
	int arr[SIZE];
} array;

array riempiArray(int arr[SIZE], int size);
void stampaArray(int arr[SIZE], int size);
void azzeraPari(int arr[SIZE], int size);

int main(void) {
	int arr[SIZE];
	int size = SIZE;
	
	array numArr = riempiArray(numArr.arr, size);
	
	riempiArray(numArr.arr, size);
	stampaArray(numArr.arr, size);
	
	cout << endl;
	
	azzeraPari(numArr.arr, size);
	
	stampaArray(numArr.arr, size);
	
	return 0;
}

array riempiArray(int arr[SIZE], int size) {
	srand(time(NULL));
	array numArr;
	for (int i = 0; i < size; i++) {
		numArr.arr[i] = rand() % (MASSIMO - MINIMO + 1) + MINIMO;
	}
	return numArr;
}

void stampaArray(int arr[SIZE], int size) {
	for (int i = 0; i < size; i++) {
		cout << arr[i] << " ";
	}
}

void azzeraPari(int arr[], int size) {
	for (int i = 0; i < size; i++) {
		if (arr[i] % 2 == 0) {
			arr[i] = 0;
		}
	}
}