16/10/07 10:59:44.51 1a/aMfXp.net
>>824
ruby
if gets.chomp!.split(/[c+-]/, -1).include?('')
puts:ERROR
else
str = $_.include?(?c)? $_[/c\K[^c]*$/] : $_
ary = str.split(/\b/)
ary.each_with_index{|s, i|
case s
when /^\d+$/ then next
when ?+ then ary[i - 1].succ!
when ?- then ary[i + 1] = (ary[i + 1].to_i - 1).to_s
end
ary.delete_at(i)
}
puts ary*''
end