算陣列平均值
宣告一個陣列(5,8,2,3,7,6,9,1,4,8,3,0),然後計算這些元素的平均值

輸出結果:
Array ( [0] => 5 [1] => 8 [2] => 2 [3] => 3 [4] => 7 [5] => 5 [6] => 9 [7] => 1 [8] => 4 [9] => 8 [10] => 3 [11] => 0 )
陣列總平均值為:4.5833333333333

輸出結果:
Array ( [0] => 5 [1] => 8 [2] => 2 [3] => 3 [4] => 7 [5] => 5 [6] => 9 [7] => 1 [8] => 4 [9] => 8 [10] => 3 [11] => 0 )
陣列總平均值為:4.5833333333333
留言
張貼留言