написал
#include <iostream>
#include<time.h>
using namespace std;
const int ABSLIMIT = 10;
int rrand(int range_min, int range_max) {
return rand() % (range_max - range_min + 1) + range_min;
}
void set_random_values(int* ar, unsigned int rows, unsigned int cols) {
// инициализация массива случайными значениями из диапазона -ABSLIMIT..ABSLIMIT
for ( int i = 0; i < rows; i++)
{
for (int j = 0; j < cols; j++)
{
ar[i][j] = rrand(-ABSLIMIT, ABSLIMIT);
}
}
}
void print_values(unsigned int* ar, unsigned int rows, unsigned int cols) {
for ( int i = 0; i < cols; i++) {
for (int j = 0;j < cols; j++) {
cout << "Значение элемента массива [" << i << "][" << j << "]= " << ar[i][j]<< endl;
}
}
int trans(unsigned int* ar, unsigned int rows, unsigned int cols, int transs)
{
for ( int i = 0; i < cols; i++)
{
for ( i = 0; i < cols; i++)
{
transs[j][i] = ar[i][j];
}
}
} return transs;
int main()
{
srand(time(0));
setlocale(LC_ALL, "Russian");
cout << "Введіть кількість рядків";
cin >> rows;
cout << "Введіть кількість стовпчиків";
cin >> cols;
int j, i, rows, cols;
unsigned int** ary = new unsigned int[rows];
for (i = 0; i < rows; i++)
{
arr[i] = new unsigned int[cols];
}
set_random_values(ary, rows, cols);
print_values(ary, rows, cols);
trans(ary, rows, cols);
system("pause");
return 0;
}