using System;
public class Program
{
public static void Main()
int[] a = { 5, 1, 6, 2, 4, 3 };
int i, j, temp;
for (i = 0; i < a.Length; i++)
bool flag = false;
for (j = 0; j < a.Length - i - 1; j++)
if (a[j] > a[j + 1])
temp = a[j];
a[j] = a[j + 1];
a[j + 1] = temp;
flag = true;
}
if (!flag)
break;
for (int k = 0; k < a.Length; k++)
Console.WriteLine(a[k]);