class Arraydef inject(n,&f)each{|i| n=f.call(n,i)}nendend
puts (1..5).to_a.inject(1){|n,i| n*i}puts (1..5).to_a.inject(0){|n,i| n+i}