問題及**:
/*
* 檔名稱:test.cpp
* 作 者:李盈盈
* 完成日期:2023年 11 月 24日
* 版 本 號:v1.0
* * 問題描述:用選擇法按降序順序排序
* 輸入描述:無
* 程式輸出:降序排序的有序數列
*/#include using namespace std;
void select_sort(int a[ ],int h);
void output_array(int a[ ],int b);
int main()
; int b[15]= ;
select_sort(a,20);
output_array(a,20);
select_sort(b,15);
output_array(b,15);
return 0;
}void select_sort(int a[ ],int h)
{ int i,j,k,t;
for (i=0; i=0; n--)
cout<
執行結果:
第13周專案4 陣列的排序(3 選擇排序)
檔名稱 123.cpp 完成日期 2014年11月23日 版本號 v1.0 問題描述 編寫程式,利用選擇排序法進行陣列的排序。輸入描述 略。程式輸出 輸出排序後的陣列。include using namespace std int select sort int arr,int n int outp...
第13周 專案4
檔名稱 main.cpp 作 者 肖雪 完成日期 2016年6.14 版 本 號 v1.0 問題描述 設計乙個抽象類csolid,含有用於求表面積及體積的兩個純虛函式。設計派生類ccube cball ccylinder,分別表示正方體 球體及圓柱體。在main 函式中,定義csolid p p是指...
第13周專案4 陣列的排序(3)
檔名稱 annpion.cpp 完成日期 2014年11月23日 版本號 v1.0 問題描述 編寫函式,完成選擇性排序。輸入描述 不輸入。程式輸出 輸出陣列選擇性排序後的順序。include using namespace std void bubble sort int a,int n void ...