diff --git a/sortowanie/Program.cs b/sortowanie/Program.cs new file mode 100644 index 0000000..0149d3a --- /dev/null +++ b/sortowanie/Program.cs @@ -0,0 +1,43 @@ +using System; + +namespace szkola_2._0 +{ + + class Program + { + + public static void sortowanie() + { + + } + + static void Main(string[] args) + { + int[] sort = {21, 14, 1, 66, 45}; + + int length = 5; + do + { + for(int i=0; i<4; i++) + { + if(sort[i]>sort[i+1]) + { + int support = sort[i]; + sort[i] = sort[i+1]; + sort[i+1] = support; + } + } + length--; + } + while(length>1); + for(int j = 5 - 1; j >= 0; j--) + { + Console.Write(sort[j] + ","); + } + } + + + + + } +} diff --git a/sortowanie/Szkola.csproj b/sortowanie/Szkola.csproj new file mode 100644 index 0000000..2082704 --- /dev/null +++ b/sortowanie/Szkola.csproj @@ -0,0 +1,8 @@ + + + + Exe + net5.0 + + +