postfix to infix by flagitious

g=proc{|q|(i='+-*/'.index$`[/.$/])?(b=$&+g[i]
t=g[i&=2]+b
i<q ?"(#{t})":t):$&}
puts g[0]while/$/=~gets

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page