From 155634f1d8eb301beef05d2237ab857079f79b45 Mon Sep 17 00:00:00 2001 From: Adelina888 Date: Sat, 29 Jun 2024 17:25:47 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D0=B5=D1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Praktika/Form1.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Praktika/Form1.cs b/Praktika/Form1.cs index 797d631..3afaa2c 100644 --- a/Praktika/Form1.cs +++ b/Praktika/Form1.cs @@ -223,7 +223,7 @@ namespace Praktika } else if (flag == 6) { - richTextBox1.Text = ""; + richTextBox1.Text = "8. Дан целочисленный двумерный массив размера N*N. Упорядочить\r\nэлементы в матрице по возрастанию (справа налево, снизу-вверх)"; } else { @@ -487,20 +487,20 @@ namespace Praktika richTextBox1.Text = sb.ToString(); //richTextBox1.Text = array2D.ToString(); //result = string.Join(" ", array2D);*/ - /*int s = 0; + int s = 0; double ar = 0; int len2 = len; for (int j = 0; j < len2; j++) { for (int i = 0; i < len; i++) { - if (array2D[i, j] >= 0) + if (array2D[i, j] < 0 ) { s += array2D[i, j]; } } } - ar = double(s / (len * len2)); + ar = (double)s / (len * len2); //задание 5 @@ -508,7 +508,7 @@ namespace Praktika { for (int i = 0; i < len; i++) { - if (Math.Abs(array2D[i, j]) > ar) + if (Math.Abs(array2D[i, j]) > ar && array2D[i,j] != 0) { for (int k = len2; k > j; k--) { @@ -541,10 +541,10 @@ namespace Praktika } result = str; - flag = 5;*/ + flag = 5; //задание 6 - int s =0; + /*int s =0; double ar ; int len2 = len; @@ -597,7 +597,7 @@ namespace Praktika } result = str; - flag = 5; + flag = 5;*/ /*StringBuilder sbResult = new StringBuilder(); @@ -779,6 +779,7 @@ namespace Praktika } result = str; + flag = 6; } public void SortLP(int[,] arr,int r)