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[]); + } +