日期:2014-05-17 浏览次数:20675 次
//函数Maxima
static int Maxima(int[] integers, out int[] indices)
{
Debug.WriteLine("Maximum values search started.");
indices=new int[1];
int maxVal=integers[0];
indices[0]=0;
int count = 1;
Debug.WriteLine(string.Format("Maximum values initialised to {0},at element index 0.", maxVal));
for (int i = 1; i < integers.Length; i++)
{
Debug.WriteLine(string.Format("Now looking at element at index{0}",i));
if (integers > maxVal)
{
maxVal = integers[i];
count = 1;
[i]indices = new int[1];
indices[0] = i;
Debug.WriteLine(string.Format("Now maximun found,Now value is {0},at element index{1}", maxVal, i));
}
else
{