#include<bits/stdc++.h>
using namespace std;
int a[10][10],h[10],l[10],maxh,minl;
bool pd=true;
int main()
{
    for(int i=1;i<=5;i++)
        for(int j=1;j<=5;j++) cin>>a[i][j];
    for(int i=1;i<=5;i++)
    {
        maxh=-1;//重置最大值为-1 
        for(int j=1;j<=5;j++)
            if(a[i][j]>maxh)
            {
                h[i]=j;
                maxh=a[i][j];
            }
    }
    for(int i=1;i<=5;i++)
    {
        minl=99999;
        for(int j=1;j<=5;j++)
            if(a[j][i]<minl)
            {
                l[i]=j;//找到最小值所在的行 
                minl=a[j][i];
            }
    }
    for(int i=1;i<=5;i++)
        if(i==l[h[i]])
        {
            cout<<i<<" "<<h[i]<<" "<<a[i][h[i]];
            pd=false;
        }
    if(pd) cout<<"not found"<<endl;
    return 0;
 }

0 comments

No comments so far...