示例#1
0
        static void Main()
        {
            MyArray a = new MyArray(20, -10000, 10000);

            Console.WriteLine($"Массив с 20-ю элементами, заполненный случайными числами: {a.ToString()}\nКоличество пар элементов массива, в которых только одно число делится на 3: {a.NumberOfPairDivThree}");
            Console.ReadKey();
        }
示例#2
0
文件: Program.cs 项目: yon28/VAV
        static void Main(string[] args)
        {
            var my = new MyArray();

            string[] arr = MyArray.Create();
            Console.WriteLine("Сформирован массив строковых переменных: ");
            MyArray.Write(arr);
            MyArray.SortMin(arr, my.compare);
            Console.WriteLine("Отсортированный массив строковых переменных: ");
            MyArray.Write(arr);
            Console.Read();
        }
示例#3
0
        static void Main(string[] args)
        {
            int[,] FirsArrayForSum    = { { 2, 4 }, { 3, 6 }, { 7, 4 } };
            int[,] SecondArrayForSum  = { { 3, 5 }, { 6, 4 }, { 3, 7 } };
            int[,] FirsArrayForMult   = { { 2, 4 }, { 3, 6 }, { 7, 4 } };
            int[,] SecondArrayForMult = { { 3, 5, 6 }, { 4, 3, 7 } };
            int[,] ResultArray;

            ResultArray = MyArray.GetSum(FirsArrayForSum, SecondArrayForSum);
            Debug.WriteLine("\nThe array after Sum:");
            for (int i = 0; i < ResultArray.GetUpperBound(0) + 1; i++)
            {
                Debug.WriteLine("");
                for (int j = 0; j < ResultArray.GetUpperBound(1) + 1; j++)
                {
                    Debug.Write($"{ResultArray[i,j]} ");
                }
            }
            ResultArray = MyArray.GetSub(FirsArrayForSum, SecondArrayForSum);
            Debug.WriteLine("\nThe array after Sub:");
            for (int i = 0; i < ResultArray.GetUpperBound(0) + 1; i++)
            {
                Debug.WriteLine("");
                for (int j = 0; j < ResultArray.GetUpperBound(1) + 1; j++)
                {
                    Debug.Write($"{ResultArray[i, j]} ");
                }
            }
            ResultArray = MyArray.GetMultiply(FirsArrayForMult, SecondArrayForMult);
            Debug.WriteLine("\nThe array after Multiply:");
            for (int i = 0; i < ResultArray.GetUpperBound(0) + 1; i++)
            {
                Debug.WriteLine("");
                for (int j = 0; j < ResultArray.GetUpperBound(1) + 1; j++)
                {
                    Debug.Write($"{ResultArray[i, j]} ");
                }
            }
        }
示例#4
0
        static void Main(string[] args)
        {
            MyArray arr = new MyArray();

            arr.Engine();
        }