Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- const int SIZE = 6;
- int main() {
- int arr[][SIZE]{
- {17, 6, 17, 8, 7, 17},
- {7, 5, 4, 65, 9, 48},
- {1, 1, 4, 0, 6, 96},
- {7, 3, 4, 5, 53, 0},
- {0, -1, 4, 5, 73, 14},
- {1, -2, 4, 5, 74, 9},
- };
- for (int i = 0; i < sizeof(arr) / SIZE / sizeof(int); i++) {
- int firstNumber = arr[i][0];
- int minimumСoordinate = 0;
- for (int j = 0; j < SIZE; j++) {
- if (firstNumber > arr[i][j]) {
- firstNumber = arr[i][j];
- minimumСoordinate = j;
- }
- }
- int smallestNumberInARow = arr[i][minimumСoordinate];
- firstNumber = arr[0][minimumСoordinate];
- for (auto & j : arr) {
- if (j[minimumСoordinate] >= firstNumber) {
- firstNumber = j[minimumСoordinate];
- }
- }
- if (smallestNumberInARow == firstNumber) {
- cout << endl << i+1 << "-" << minimumСoordinate+1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment