您的位置:首页 > 其它

对数组进行排序并重新显示出来

2017-07-06 21:32 267 查看
        static void Main(string[] args)

        {

            

            int[] arr1 = new int[] { 1, 3, 4,232, 4, 23, 222, 3, 3, 21, 87 };

            //对数组进行排序            

            Array.Sort(arr1);

            //反转数组从大到小

            Array.Reverse(arr1);

            //数组排序后再将数组内容显示出来

            foreach (int i in arr1)

            {

                Console.WriteLine(i);

            }

            Console.ReadKey();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐