예제 #1
0
        /// <summary>
        /// Обработчик события появления формы, выводящий на неё результаты обработки массива
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Form2_Shown(object sender, EventArgs e)
        {
            string reverse = "";

            NewArray.ReverseArray();
            for (int i = 0; i < NewArray.arr.Length; i++)
            {
                reverse += NewArray.rev_arr[i].ToString() + " ";
            }
            textBox1.Text = reverse;
            NewArray.LastDigitSummCount();
            Summ.Text   = NewArray.lastdigitsum.ToString();
            Number.Text = NewArray.lastdigitcount.ToString();
            NewArray.SimpleCount();
            Simple.Text = NewArray.num_simple.ToString();
            NewArray.RangeStatistic();
            Statistic.Text = NewArray.statistic;
        }
예제 #2
0
        public void Reverse()
        {
            Lab03.Array mas = new Lab03.Array();
            int[]       exp = { 1, 2, 3, 4, 5 };
            int[]       tmp = { 5, 4, 3, 2, 1 };
            bool        res = true;

            mas.arr = tmp;
            mas.ReverseArray();
            for (int i = 0; i < 5; i++)
            {
                if (mas.rev_arr[i] != exp[i])
                {
                    res = false;
                    break;
                }
            }
            Assert.AreEqual(true, res);
        }