闲来无事,再次重新研究了冒泡排序 , int[] iArrary = new int[] { 1, 5, 13, 6, 10, 55, 99, 2, 87, 12, 34, 75, 33, 47 }; for (int i = 0; i < iArrary.Length; i++) { for (int j =i+1; j < iArrary.Length; j++) { if (iArrary[i]>iArrary[j]) { int temp = iArrary[i]; iArrary[i]=iArrary[j]; iArrary[j] = temp; } } } string str = ""; for (int z = 0; z < iArrary.Length; z++) { str += iArrary[z].ToString() + ","; } textBox1.Text = str;