fork download
  1. s = gets.strip
  2. e = "#{s}+#{s.size}+(#{s.split(/(?<!-)/).join '+'})"
  3. puts "#{e}=#{eval e}"
Success #stdin #stdout 0.05s 9656KB
stdin
-1-2-3
stdout
-1-2-3+6+(-1+-2+-3)=-6