a=[1, 2, 3]b=[4, 5, 6]a.product(b){ |(x,y)| puts "#{x}+#{y}=#{x+y}" }
Standard input is empty
1+4=5 1+5=6 1+6=7 2+4=6 2+5=7 2+6=8 3+4=7 3+5=8 3+6=9
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!