int index = 0;
int[] points = new int[8] { 18, 25, 7, 36, 13, 2, 89, 63 };
int min = points[0];
for (int i = 0; i < points.Length; i++)
{
if (min > points[i]) ;
{
min = points[i];
index= i;
}
}
Console.WriteLine("min= " + min + ",原始位置 = " + index);
Console.Read();
网友评论