#include <iostream> using namespace std; int main() { int num[20][20]{ 0 }; int n, m; // Ввод количества строк и столбцов cout << "Введите количество строк (не более 20): "; cin >> n; cout << "Введите количество столбцов (не более 20): "; cin >> m; cout << "Введите элементы матрицы:" << endl; for (int i = 0; i < n; i++) // цикл по строкам { for (int j = 0; j < m; j++) // цикл по столбцам { cout << "num[" << i << "," << j << "]= "; cin >> num[i][j]; } } int max = num[0][0], min; for (int i = 0; i < n; i++) { min = num[i][0]; for (int j = 1; j < m; j++) { if (num[i][j] < min) min = num[i][j]; } if (max < min) max = min; } cout << max << endl; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter