You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
879 B
43 lines
879 B
using System;
|
|
|
|
namespace szkola_2._0;
|
|
{
|
|
|
|
class Program
|
|
{
|
|
|
|
public static void sortowanie(int[] sort;)
|
|
{
|
|
int length = sort.length;
|
|
do
|
|
{
|
|
for(int i=0; i<length-1; 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 = length-1; j >= 0; j--)
|
|
{
|
|
Console.Write(sort[j] + ",");
|
|
}
|
|
}
|
|
|
|
static void Main(string[] args)
|
|
{
|
|
int[] sortowanie = {21, 14, 1, 66, 45};
|
|
|
|
sortowanie(sortowanie[]);
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|