代码块:
#include
using namespace std;
int main()
{
int n[3][3], i, j, m, p, c=0, min, max;
for (i=0; i<3; i++){ //输入一个3*3数组
cout<<"Please enter row "<1<<" numbers: ";
for (j=0; j<3; cin>>n[i][j++]);
}
for (i=0; i<3; i++){
for (j=0, max=n[i][j]; j<3; j++)
if (n[i][j]>max){ //判断出该行上最大的数,固定行号和列号
max=n[i][j], m=i, p=j;
}
for (j=0, min=n[m][p]; j<3; j++) //对比该列上的数,一旦有比固定的最大数还小的,中断循环
if (n[j][p]break;
if (j==3){ //如果循环正常结束没有中断,输出鞍点,同时有鞍点则判断变量c为真
c=1;
cout<<"Result: "<cout<<"Row= "<1<<" Column= "<1<if (!c) cout<<"No match!"<//如果判断变量c值始终为初值,输出无鞍点
system("pause");
return 0;
}