综合练习1数组一

#作业代码:

      int[] points = { 18, 25, 7, 36, 13, 2, 89, 63 };

            int min = points[0];

            int index = 0;

            for (int i = 1; i < points.Length; i++)

            {

                if (min > points[i])

                {

                    min = points[i];

                    index = i;

                }   

            }

            Console.WriteLine("最小值为:{0},位置为:{1}", min, index);

                Console.ReadKey();

#作业效果:


你可能感兴趣的:(综合练习1数组一)