Beispiel #1
0
        } //生成升序数组//static void CreateArray_ASC()

        static void CreateArray_Random()   //随机数数组
        {
            CArray nums = new CArray(10);
            Random rnd  = new Random(100);

            for (int i = 0; i < 10; i++)
            {
                nums.Insert(rnd.Next(0, 100));
            }
            nums.DisplayElements();
        }//生成随机数数组//static void CreateArray_Random()
Beispiel #2
0
        //排序-----------分隔线---------------
        static void CreateArray_ASC()   //升序数组
        {
            CArray nums = new CArray(50);

            for (int i = 0; i <= 49; i++)
            {
                nums.Insert(i);
            }
            nums.DisplayElements();
            Console.ReadKey();
        } //生成升序数组//static void CreateArray_ASC()