Exemple #1
0
        static void Main(string[] args)
        {
            TPR obj = new TPR(6, 4);

            obj.PriorityAlgorythm();
            obj.PrintRank();
            Console.ReadKey();
        }
Exemple #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (check)
            {
                try
                {
                    label4.Text = " ";
                    int[,] MA   = new int[RowIndex, ColumnIndex];
                    for (int i = 0; i < ColumnIndex; i++)
                    {
                        for (int j = 0; j < RowIndex; j++)
                        {
                            MA[j, i] = Convert.ToInt32(dataGridView1.Rows[j].Cells[i].Value);
                        }
                    }

                    string[] str = textBox3.Text.Split(' ');
                    int[]    RA  = new int[str.Length];
                    for (int i = 0; i < str.Length; i++)
                    {
                        RA[i] = Convert.ToInt32(str[i]);
                    }
                    TPR table = new TPR(RowIndex, ColumnIndex, MA, RA);
                    table.PriorityAlgorythm();
                    printRank(table);
                }
                catch (Exception ex)
                {
                    label4.Text = "Неправильно заданные приоритеты";
                }
            }
            else
            {
                label4.Text = "Создайте таблицу!";
            }
        }