阿摩線上測驗
登入
首頁
>
程式設計
>
103年 - 103年高等三級暨普通考普通_資訊處理#29119
>
題組內容
三、假設書架上有七本書,已知每一本書的高度都不一樣,請以下列方式進行排序:第 一個與第二個位置上的書先比較,較低的書放到第一個位置,較高的書放到第二個 位置;再來第二個與第三個位置的書相比較,依此類推。第一輪做完後,再從頭開 始進行第二輪的比較與交換,然後再進行第三輪、第四輪等,直至第六輪結束為止。
4.請以上述宣告的一維陣列資料結構為基礎,用 C, C++或 Java 寫出上述排序演算 法。(10 分)
其他申論題
2.請改寫該程式片段,在不使用迴圈的情況下可以得到相同的結果。(15 分)<br> scanf (“%d”, &n);<br> if (n > 0)<br> ??????<br> printf (“%d<br>”, m);
#59726
1.若這七本書高度分別為 15, 12, 17, 18, 11, 14, 19,請問每一輪需交換書本位置的次 數為何?(10 分)
#59727
2.若總共有 n 本書本,最多共需交換幾次書本才能排序完成?(5 分)
#59728
3.請宣告並說明如何以一維陣列 books[n]來表示書本的位置與高度。(5 分)
#59729
品牌 庫存 銷售數 Volvo 18 20 Luxgen 57 145 Toyota 41 78 Honda 17 15 1.請宣告二維陣列$cars 並事先儲存上述四種汽車品牌、庫存、銷售數。(5 分)
#59731
【已刪除】一、試利用離心式泵的基本原理解釋為何使用時須引注水?有那些常用的引注水方法? (20 分)
#59732
【已刪除】二、影響往復式空氣壓縮機排氣量的因素為何?(20 分)
#59733
【已刪除】三、造水機系統的操作管理應注意事項為何?(20 分)
#59734
【已刪除】四、冷凍系統中,冷媒壓縮機排出壓力過高的原因及採取之對策為何?(20 分)
#59735
【已刪除】五、請將下列英文譯成中文:(20 分) The bilge separator consists of a tank divided into several zones by internal baffles. A positive displacement bilge pump supplies unprocessed oil/water downstream into the purifier and simultaneously discharges treated water out of the tank. As the oil/water mixture flows through the tank, oil droplets are attracted to the coalescer beads while water is repelled under the influence of gravity and heat. Water passes around the beads but oil temporarily attaches to them. Oil droplets accumulate on the beads until they become large enough to break away and float to the top of the tank.
#59736