/*
Nome: Mario
Cognome: Montanari

Matrice Antisimmetrica
*/

#include <iostream>
#include <cstdlib>
#include <array>
#include <ctime>
#include <iomanip>

#define NROW 4
#define NCOL 4
#define VMIN -50
#define VMAX 50

using namespace std;

void fillMatrix(int matrix[][NCOL], int nrow, int ncol);
void printMatrix(int matrix[][NCOL], int nrow, int ncol);

int main(void) {
	int matrix[NROW][NCOL];
	
	fillMatrix(matrix, NROW, NCOL);
	printMatrix(matrix, NROW, NCOL);
	
	return 0;
}

void fillMatrix(int matrix[][NCOL], int nrow, int ncol) {
	srand(time(NULL));
	for (int i = 0; i < nrow; i++) {
		for (int j = 0; j < ncol; j++) {	
			int value = rand() % (VMAX - VMIN + 1) + VMIN;
            matrix[i][j] = value;
            matrix[j][i] = -value;
		}
	}
}

void printMatrix(int matrix[][NCOL], int nrow, int ncol) {
	for (int i = 0; i < nrow; i++) {
		cout << endl;
		for (int j = 0; j < ncol; j++) {
			cout << setw(5) << matrix[i][j];
		}
		cout << endl;
	}
	cout << endl;
}