冒泡排序基础
static void Main(string[] args) { int[] a = { 3, 1, 5, 7, 2, 4, 9, 6 }; for (int i = 0; i < a.Length - 1; i++) { for (int j = 0; j < a.Length - i - 1; j++) { if (a[j] > a[j + 1]) { int temp = a[j]; a[j] = a[j + 1]; a[j + 1] = temp; } for (int q = 0; q < a.Length; q++) { Console.WriteLine(a[q] + ","); } } } for (int q = 0; q < a.Length; q++) { Console.WriteLine(a[q] + ","); } }