/*Cristian Ronzoni 3Ain
generare una matrice antidiagonale 
con valori casuali */
#include <iostream>
#include <iomanip>
#include <ctime>
#include <cstdlib>
#define DIA 5
#define MAX 9
#define MIN 1
using namespace std;

void antiDia(int arr[DIA] [DIA]){
	for(size_t i = 0; i<DIA; ++i){
		for(size_t j = 0; j<DIA; ++j){
			if(i+j == DIA -1){
				arr[i] [j] = rand() % ((MAX-MIN)+1) +MIN;
			}
			else
				arr[i] [j] = 0;
		}
		
		
	}
	
}

void stampa(int arr[DIA] [DIA]){
	
	for(size_t i = 0; i<DIA; ++i){
		for(size_t j = 0; j<DIA; ++j){
			
			cout << setw(3) << arr[i] [j] << " ";
			
		}
		cout << endl;
	}
	
	
}

int main(void){
	
	
	srand(time(NULL));
	
	int arr[DIA] [DIA];
	
	antiDia(arr);
	stampa(arr);
	
	
}
