using System;

namespace C取最大值
{
    class Program
    {
        static int Max(int[] array){
            int  max=array[0];
            for (int i = 1; i < array.Length ; i++) {
                if(array[i]>max){
                    max=array[i];
                }
            }
            return max;
        }
        public static void Main(string[] args)
        {
            int[]array={23,3434,435,4543,435,43,345,34,435,5,43,45};
            Console.WriteLine(Max(array));
            // TODO: Implement Functionality Here
            
            Console.Write("Press any key to continue . . . ");
            Console.ReadKey(true);
        }
    }
}

 

版权声明:本文为llhhcc原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/llhhcc/p/9822525.html