One way is to iterate through the list and start adding them up one by one. In Ruby, you could write this as array.inject(&:+) .
確定! 回上一頁