//資料為 x 陣列 //汽泡排序 int x[N]={7, 9, 5, 6, 8}; void BubbleSort(){ int i, j; for(i=0; ix[j+1]) swap(x[j],x[j+1]); //交換 return 0; }