Esempio n. 1
0
        private void TextBox_KeyUp(object sender, KeyEventArgs e)
        {
            if (ElMass1.Text != "")
            {
                if (e.Key == Key.Enter)
                {
                    if (j == 5)
                    {
                        i++;
                        j = 0;
                    }

                    MassOut1.Text = "";
                    for (int a = 0; a < 4; a++)
                    {
                        for (int b = 0; b < 5; b++)
                        {
                            mass1[i, j] = Int32.Parse(ElMass1.Text);
                            MassOut1.AppendText(mass1[a, b].ToString() + " | ");
                        }

                        MassOut1.AppendText(" \n ");
                    }
                    j++;
                    ElMass1.Text = "";
                }
            }
        }
Esempio n. 2
0
        private void btnMass1_Click(object sender, RoutedEventArgs e)
        {
            MassOut1.AppendText("\n \n");
            int[] mass11   = new int[4];
            int   podCount = 0;

            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 5; j++)
                {
                    if (mass1[i, j] < 0 && (mass1[i, j] % 3 == 0 || mass1[i, j] % 5 == 0))
                    {
                        podCount++;
                    }
                }
                mass11[i] = podCount;
                podCount  = 0;
                MassOut1.AppendText(mass11[i].ToString() + " ");
            }
        }