hdoj 2022

来源:互联网 发布:光大证券mac版下载 编辑:程序博客网 时间:2024/03/28 17:11

/* 1.行与列注意别混淆;

    2.每组数据x,y都需要初始化;

    3.把矩阵看成数据流;

*/


#include<iostream>
#include<cmath>
using namespace std;


int main()
{
    int n,m,x=1,y=1,max,t;
    while(cin>>m>>n)
    {
        for(int i=0;i<m;i++)
            for(int j=0;j<n;j++)
            {
                cin>>t;
                if(i==0&&j==0)
                {
                    max=t;
                    x=1;
                    y=1;
                }
                else
                {
                    if(abs(t)>abs(max))
                    {
                       y=i+1;
                       x=j+1;
                       max=t;
                    }
                }
            }
        cout<<y<<" "<<x<<" "<<max<<endl;
    }
    return 0;

0 0
原创粉丝点击