Home > Net >  Looking for a saddle point
Looking for a saddle point

Time:11-04

Is there a big help which wrong ah, look at my freshman exercises
 using System;
Using System. Collections. Generic;
Using System. Linq;
Using System. The Text;
Using System. The Threading. The Tasks;

The namespace for saddle point
{
Class Program
{
The static void Main (string [] args)
{
Int n=int. Parse (Console. ReadLine ());
Int [and] ar=new int [n, n];
Int a, b, c, d, x=0;
Int [] Max=new int [n].
Int [] min=new int [n].
Bool flag=false; ;
For (int I=0; i {
Int [] arr=new int [n].
Arr=Array. ConvertAll (Console. ReadLine (). The Split (' '), int. J Parse);
For (int j=0; j Ar [I, j]=arr [j];
}
For (a=0; A. & lt; n; +)
{
Int max1=ar [a, 0];
For (b=1; B & lt; n; B++)
{
If (max1 & lt; Ar [a, b])
{
Max1=ar [a, b];
Max [a]=b;
}
}
}
For (c=0; C & lt; n; C + +)
{
X=ar [c, Max [c]].
For (d=1; D & lt; n; D++)
{
If (x & gt;=ar [d, Max [c]])
{
X=ar [d, Max [c]].
Min [c]=d;
}
}
If (min [c]==c)
{
flag=true;
Console. WriteLine (c + "" + Max [c]);
}

}
If (flag==false)
{
Console. WriteLine (" NONE ");
}
Console.ReadLine();


}
}
}

CodePudding user response:

Minimum line biggest columns, first find lines, most get minimum column,
  •  Tags:  
  • C#
  • Related