#include <iostream>
#define OK 1
#define ERROR 0
using namespace Std;
typedef int ELEMTYPE;
typedef struct MATRIX
{
Elemtype **a;
int cloumn,row;
} *matrix,matrix;
/*
Www.quzhuanpan.com
Interpretation of the power from the turntable network, reprint please inform
*/
Elemtype creat (Matrix &m)
{
int i,j;
cin>>m->row>>m->cloumn;
M->a=new int*[m->row];
for (i=0; i<m->row; i++)
{
M->a[i]=new int[m->cloumn];
}
for (i=0; i<m->row; i++)
for (j=0; j<m->cloumn; j + +)
cin>>m->a[i][j];
return OK;
}
int Display (Matrix &m)
{
int mark_y;
int mark_x;
int temp;
int i,j;
for (i=0; i<m->row; i++)
{
temp=m->a[i][0];
Mark_x=i;
mark_y=0;
for (j=1; j<m->cloumn; j + +)
{
if (m->a[i][j]<temp)
{
temp=m->a[i][j];
Mark_x=i;
Mark_y=j;
}
}//find the smallest line, and write down his subscript.
for (j=0; j<m->row; j + +)
{
if (m->a[j][mark_y]>temp)
Break
}//to see if it is the largest in the column
if (J==m->row)
{
cout<<mark_x<< "" <<mark_y<< "" <<temp<<endl;
return ERROR;
}
}
cout<< "Not found!" <<endl;
return OK;
}
int Destroymatrix (Matrix &m)
{
int i;
for (i=0;i<m->row;i++)
{
Delete []m->a[i];
}
Delete []m->a;
return OK;
}
/*
Www.quzhuanpan.com
Interpretation of the power from the turntable network, reprint please inform
*/
int main ()
{
Matrix M;
Creat (M);
Display (M);
Destroymatrix (M);
return 0;
}
C-language saddle point problem processing