Robert Dober wrote:
> On Mon, Mar 8, 2010 at 10:38 PM, Prasanth Ravi <dare.take / gmail.com> 
> wrote:
>>>> puts gets.split(' ').inject(0){|sum,x| x.to_i>0?sum+x.to_i : sum}
>>> Cheers
>>> R.
>>
>> puts gets.split.map(&:to_i).select{|x| x>0}.inject(&:+)
>>
>> --53 chars
>>
> 
> I feel that your code has less characters and mine is shorter :)
> R.

yea your's is definitely better(it's more readable), but the problem 
measure the code by character count :D
-- 
Posted via http://www.ruby-forum.com/.