Ответ:
#include
#include
#include
#define M 5
#define N 5
using namespace std;
int main()
{
int A[M][N];
int C[M - 1][N - 1];
int i, j, min, min_index, zero_cnt = 0;
setlocale(LC_ALL, "Russian");
srand(time(0));
cout
for (i = 0; i < M; i++)
{
for (j = 0; j < N; j++)
{
A[i][j] = rand() % 101 - 50;
cout
if ((i == 0) && (j == 0)) min = A[i][j];
if (A[i][j] < min)
{
min_index = i * M + j;
min = A[i][j];
}
}
cout
}
for (i = 0, j = 0; i < M * N; i++)
if ((i / M != min_index / M) && (i % M != min_index % M))
{
C[0][j] = A[0][i];
if (C[0][j++] == 0) zero_cnt++;
}
cout
for (i = 0; i < M - 1; i++)
{
for (j = 0; j < N - 1; j++)
{
if (i == 0)
{
min = C[i][j];
C[i][j] = C[M - 2][j];
C[M - 2][j] = min;
}
cout
}
cout
}
cout
return 0;
}