int[] array = { 1, 3, 5, 2, 4, 6, 7, 9, 8, 8 };
            var max = array.Max();//获取数组中的最大值 第一种
            //第二种方法
            var max2 = array[0];
            for (int i = 0; i < array.Length; i++)
            {
                if (max2 < array[i])
                    max2 = array[i];
            }
            Console.WriteLine(max2);
            Console.ReadKey();

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-03
  • 2022-03-01
  • 2021-08-19
猜你喜欢
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2022-02-24
  • 2022-12-23
相关资源
相似解决方案