Ruby で小町算

とある use case のためにでっちあげたものをもうちょっといじってみた
うちのワーキングコピーからビルドした ruby でないと動きませんw
nil.to_s が急に "nil" になっても大丈夫なようにちょこっと細工があったりとか

require 'rational'

class Fixnum
	def / other
		Rational(self, other)
	end
end

['+', '-', '*', '/', ''].repeated_permutation(8).each{|ops|
	ops << ''
	s = '123456789'.each_char.zip(ops).flatten.join('')
	n = eval s
	if n == 100 then
		p s
	end
}