diff --git a/Practika/Practika/Form1.cs b/Practika/Practika/Form1.cs index 8b34570..9d96746 100644 --- a/Practika/Practika/Form1.cs +++ b/Practika/Practika/Form1.cs @@ -1,5 +1,7 @@ +using System.Drawing.Drawing2D; using System.Text; using System.Windows.Forms; +using System.Xml.Linq; namespace Practika { @@ -89,8 +91,6 @@ namespace Practika private void button8_Click_1(object sender, EventArgs e) { textBoxMassive.Clear(); - - string input = textBoxTake.Text; string[] rows = input.Split(';'); CountLine = rows.Length; @@ -108,7 +108,7 @@ namespace Practika } else { - MessageBox.Show("Îøèáêà !"); + MessageBox.Show("!"); return; } } @@ -124,6 +124,8 @@ namespace Practika } + + private void button9_Click_1(object sender, EventArgs e) { @@ -191,21 +193,21 @@ namespace Practika int l = -1; for (int i = 0; i < n; i++) { - if (array1[i] > 0) + if (array1[i] < 0 && l != 0) { - l= i; + l = i; } } - for (int i = n - 1; i > l+1; i--) + for (int i = n - 1; i > l + 1; i--) { array1[i] = array1[i - 1]; } - if (l + 1 <= n) - { - array1[l+ 1] = -1; - } + + array1[l + 1] = -1; + + textBoxEnd.Text = string.Join(" ", array1); @@ -215,11 +217,108 @@ namespace Practika case 4: + int w = Array1size ; + int o = 0; + for (int i = 0; i maxPosValue && array2[i, j] < 0) + { + maxPosValue = array2[i, j]; + columnToDelete = j; + } + } + } + for (int j = columnToDelete; j < CountLine - 1; j++) + { + for (int i = 0; i < Count; i++) + { + array2[i, j] = array2[i, j + 1]; + } + } + for (int i = 0; i < Count; i++) + { + array2[i, Count - 1] = 0; + } + + + for (int i = 0; i < Count; i++) + { + for (int j = 0; j < CountLine - 1; j++) + { + textBoxEnd.Text += array2[i, j].ToString() + " "; + } + textBoxEnd.Text += Environment.NewLine; + } + + break; case 6: + int minElement = int.MaxValue; + int rowWithMinElement = -1; + for (int i = 0; i < Count; i++) + { + for (int j = 0; j < CountLine; j++) + { + if (array2[i, j] < minElement) + { + minElement = array2[i, j]; + rowWithMinElement = i; + } + } + } + for (int j = 0; j array2[rowWithMinElement, k + 1]) + { + for (int i = 0; i