was equal to the largest of the elements of the matrix A, which are in the same line and in the same column as the element. I wrote a program that looks for the maximum elements in the columns and rows of the matrix A. Now, in theory, you need to find the maximum elements in those two columns again, but how to do it? And how to fill the matrix B with these elements? I think in that direction?))
int main() { int n; cout << "Order of matrix A is " << endl; cin >> n; cout << endl; int** A = new int* [n]; for (int i = 0; i < n; i++) A[i] = new int[n]; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { A[i][j] = rand() % 100; cout << setw(3) << A[i][j] << " "; } cout << endl; } cout << endl; int max; int** B = new int* [n]; max = A[0][0]; for (int c = 0; c < n; c++) { for (int a = 0; a < n; a++) { if (max < A[c][a]) max = A[c][a]; } cout << max << endl; max = 0; } cout << endl; for (int a = 0; a < n; a++) { for (int c = 0; c < n; c++) { if (max < A[c][a]) max = A[c][a]; } cout << max << endl; max = 0; } return 0; }