From 28cbb45890b22ad41e477e9ef6131ff9a2b0f136 Mon Sep 17 00:00:00 2001 From: MateushK Date: Mon, 10 May 2021 01:05:27 +0200 Subject: [PATCH] Update Program.cs poprawki --- sortowanie/Program.cs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sortowanie/Program.cs b/sortowanie/Program.cs index 0149d3a..e8e3bd2 100644 --- a/sortowanie/Program.cs +++ b/sortowanie/Program.cs @@ -1,24 +1,17 @@ using System; -namespace szkola_2._0 +namespace szkola_2._0; { class Program { - public static void sortowanie() + public static void sortowanie(int[] sort;) { - - } - - static void Main(string[] args) - { - int[] sort = {21, 14, 1, 66, 45}; - - int length = 5; + int length = sort.length; do { - for(int i=0; i<4; i++) + for(int i=0; isort[i+1]) { @@ -30,12 +23,19 @@ namespace szkola_2._0 length--; } while(length>1); - for(int j = 5 - 1; j >= 0; j--) + for(int j = length-1; j >= 0; j--) { Console.Write(sort[j] + ","); } } + static void Main(string[] args) + { + int[] sortowanie = {21, 14, 1, 66, 45}; + + sortowanie(sortowanie[]); + } +