Description
输入一个二维 (5*5)数组,每行只有一个最大值,每列只有一个最小值。
如果存在鞍点,则输出鞍点所在的位置(行和列),不存在鞍点时,要输出“not found”。
鞍点指的是数组中的一个元素,它是所在行的最大值,并且是所在列的最小值。
例如:在下面的例子中(第4行第1列的元素就是鞍点,值为8 )。
11 3 5 6 9
12 4 7 8 10
10 5 6 9 11
8 6 4 7 2
15 10 11 20 25
Input
输入包含一个5行5列的矩阵
Output
如果存在鞍点,输出鞍点所在的行、列及其值,如果不存在,输出"not found"
Sample Input
11 3 5 6 9
12 4 7 8 10
10 5 6 9 11
8 6 4 7 2
15 10 11 20 25
Sample Output
4 1 8
Hint
无
#include <iostream>
#include<stdio.h>
#include <iomanip>
#include<math.h>
using namespace std;
int main() {
int mat[5][5], max[5] = {
0 }, min[5