第十三周專案4 陣列的排序(冒泡法)

2021-06-27 07:48:56 字數 611 閱讀 9622

* 輸入描述:

* 程式輸出:降序排列陣列的數並輸出 */

#include using namespace std;

void bubble_sort(int a,int n);

void output_array(int a,int n);

int main( )

; int b[15]= ;

bubble_sort(a,20); //用冒泡法按降序排序a中元素

output_array(a,20); //輸出排序後的陣列

bubble_sort(b,15); //用冒泡法按降序排序b中元素

output_array(b,15); //輸出排序後的陣列

return 0;

}//請在下面定義bubble_sort和output_array函式

第十三周專案 4 陣列的排序(數字氣泡排序)

檔名稱 main.cpp 作 者 韓娟 完成日期 2014年11月21日 版 本 號 v1.0 問題描述 編寫函式,完成氣泡排序 輸入描述 略 程式輸出 陣列降序排序 include include using namespace std void bubble sort int y,int n v...

第十三周專案四 氣泡排序

問題及 檔名稱 test.cpp 作 者 劉佳琦 完成日期 2014年 11 月 23 日 版 本 號 v1.0 問題描述 編寫程式,完成氣泡排序 輸入描述 無 程式輸出 氣泡排序後的逆序輸出 include using namespace std void bubble sort int arr,...

第十三周專案4 (1)氣泡排序

問題及 檔名稱 test.cpp 完成日期 2014年 11 月 24 日 版本號 v1.0 問題描述 氣泡排序問題 程式輸出 有序輸出 includeusing namespace std void bubble sort int sor,int num void output array int...