Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <locale.h>
- #define n 5
- #define m 7
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Russian");
- int a[n][m] = { {-2, 0, 10, 99, 4,6,8},{-32,7,39,11,4,8,24 }, {5, 4, 3, 0, 8, 6, 5}, {4, 3, 0, -33, 5, 6, -3}, 3, 32, 33, 56, 12,12,3 };
- cout << "Исходная матрица" << endl;
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < m; j++) {
- printf("%3d", a[i][j]);
- }
- cout << endl;
- }
- int mi = a[0][0];
- for (int i = 0; i < n; i++) {
- for (int j = m - 2 - i; j >= 0; j--) {
- if (a[i][j] < mi)
- mi = a[i][j];
- }
- }
- cout << "Минимальное значение выше побочной диагонали = " << mi << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement