using System;
public class Program
{
public static void Swap(ref int x, ref int y)
{
int t = x;
x = y;
y = t;
}
public static void BubbleSort(int[] arr)
{
for(int i = 0; i < arr.Length; i++)
for(int j = 0; j < arr.Length - 1 - i; j++)
{
if(arr[j] > arr[j+1])
Swap(ref arr[j], ref arr[j+1]);
}
}
public static void Main()
{
int[] arr = new int[]{7,6,10,5,4,1,2,9,1};
BubbleSort(arr);
foreach(var x in arr)
Console.Write(x + " ");
}