From: as Date: 2008-08-16T17:32:02+09:00 Subject: Re: im new... so can i have some help Le Fri, 15 Aug 2008 18:06:38 -0500, Daniel Kindler a 辿crit : > array = [] > num = gets.to_i > while num != 0 > num = gets.to_i > array << num > end > puts array.sort.join(',') > works well so far > Now, how would i take the numbers in the array, and add them...... puts array.inject {|sum,n| sum+n} (http://www.ruby-doc.org/core/classes/Enumerable.html) -- Arnaud Schmittbuhl