public List<int> SortTest()
        {
            List<int> Stu = new List<int>();
            Stu.Add(5);
            Stu.Add(2);
            Stu.Add(6);
            Stu.Add(1);
            Stu.Add(9);
            Stu.Sort(delegate(int a, int b) //不可用于数组排序
            {
                return b.CompareTo(a);//从大到小
            });

            return Stu;
        }

 

相关文章:

  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2021-12-12
  • 2021-06-17
  • 2021-11-06
猜你喜欢
  • 2021-10-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-02
  • 2022-12-23
相关资源
相似解决方案