#include
#include
#include
using namespace std;
void show_array(int **, const size_t, const size_t);
int main() {
srand(unsigned(time(0)));
const size_t rows = 5, cols = 5;
int ** matrix = new int * [rows];
for (rsize_t row = 0; row < rows; row++) {
matrix[row] = new int [cols];
for (rsize_t col = 0; col < cols; col++)
matrix[row][col] = rand() - rand();;
}
show_array(matrix, rows, cols);
for (rsize_t row = 0; row < rows; row++)
delete[] matrix[row];
delete[] matrix;
cin.get();
return 0;
}
void show_array(int ** _matrix, const size_t _rows, const size_t _cols) {
for (rsize_t row = 0; row < _rows; row++, cout << endl << endl)
for (rsize_t col = 0; col < _cols; col++)
cout << setw(8) << _matrix[row][col];
cout << endl;
}