Ejemplo n.º 1
0
        private void run_Click(object sender, EventArgs e)
        {
            try
            {
                int[] arr = TypesConverter.StrToArray <int>(input.Text);
                Utilities.ArrayTransformator ts = new Utilities.ArrayTransformator(arr);
                int[] t = ts.IncreaseFirstSeria();
                int[] c = ts.IncreaseLastSeria();
                int[] d = ts.IncreaseLongestSerias();

                resultfirstser.Text = TypesConverter.ArrayToStr(t);
                resultlastser.Text  = TypesConverter.ArrayToStr(c);
                resultmaxser.Text   = TypesConverter.ArrayToStr(d);
            }
            catch (Exception exception)
            {
                MessageBox.Show("Введите корректные данные.");
            }
        }
Ejemplo n.º 2
0
        private void run_Click(object sender, EventArgs e)
        {
            try
            {
                int            sequanceStart, maxLength;
                TypesConverter io  = new TypesConverter();
                int[]          arr = TypesConverter.StrToArray <int>(input.Text);

                ArrayTransformator a = new ArrayTransformator(arr);

                a.FindLongestSubsequence(out maxLength, out sequanceStart);
                int[] result = a.GetSubsequence(maxLength, sequanceStart);
                result_1.Text = TypesConverter.ArrayToStr(result);
            }
            catch (FormatException exception)
            {
                MessageBox.Show("Введите корректные данные");
            }
        }