10 lines
360 B
Ruby
10 lines
360 B
Ruby
|
number = Integer(ARGV.fetch(0))
|
||
|
divisor = Float(ARGV.fetch(1, 10.0))
|
||
|
|
||
|
raise 'Invalid divisor' unless divisor % 10 == 0
|
||
|
|
||
|
puts "#{number} - number"
|
||
|
puts "#{(Float(number) / divisor).round(0)} - number divided by #{divisor}"
|
||
|
puts "#{(Float(number) / divisor).round(0) * Integer(divisor)} - " \
|
||
|
"number divided by #{divisor}, multiplied by #{Integer(divisor)}"
|