[0,1,2,5,6,7,8].combination(2){|x| puts x.join(" ") }
Standard input is empty
0 1 0 2 0 5 0 6 0 7 0 8 1 2 1 5 1 6 1 7 1 8 2 5 2 6 2 7 2 8 5 6 5 7 5 8 6 7 6 8 7 8
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!