static void Main(string[] args)
        {
            int[] a = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,0,11};
            int max; 
            int min;
            int xxa=ax((a),out max, out min);

      
            Console.WriteLine("最大值{0}",max);
            Console.WriteLine("最小值{0}",min);

            Console.ReadKey();

        }
        public static int ax(int[] xx, out int max, out int min) {
            int xxa = 0;
            max = xx[0];
            min = xx[0];
            for (int i = 0; i < xx.Length; i++) {
                if (max < xx[i]) {
                    max = xx[i];
                }
                if (min > xx[i]) {
                    min = xx[i];
                }
            
            }
            return xxa;
            
        
        }

 

相关文章:

  • 2022-12-23
  • 2018-09-03
  • 2022-12-23
  • 2022-01-17
  • 2021-07-24
  • 2021-11-28
  • 2021-12-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-08
  • 2021-09-14
相关资源
相似解决方案