18 lines
208 B
Ruby
18 lines
208 B
Ruby
input = File.readlines('./input')
|
|
|
|
class Integer
|
|
def /(other)
|
|
self + other
|
|
end
|
|
|
|
def -(other)
|
|
self * other
|
|
end
|
|
end
|
|
|
|
out = input.map do |line|
|
|
eval line.tr('*+', '-/')
|
|
end
|
|
|
|
puts out.inject :+
|