2009年3月16日 星期一

Lab Finding the max of a list of numbers

Based on your study of Display 3.8, write a code to find the max and min of a list of number.
For example, given 1,3,5, and9, the max is 9 and the min is 1.
Your program should be able to process a list of any length.



主要概念是創造一個arrary,並宣告一個變數令array會往前跑(arrary[0]變arrary[1],在這裡宣告可使用arrary[0]~[99]),也就是將每次key入的數字儲存在這個arrary中(從0開始放)

而while是繼續執行的條件
.
.
.
最後就是大ㄧ有敎過的泡沫排序法...

1 則留言: