Skip to content

Instantly share code, notes, and snippets.

/playing.rb Secret

Created April 22, 2016 15:41
Show Gist options
  • Save anonymous/b745816ca7df2a4a92e3f59cae328108 to your computer and use it in GitHub Desktop.
Save anonymous/b745816ca7df2a4a92e3f59cae328108 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
a, b = gets.chomp.split(/ /).map(&:to_i)
sum = a + b
if a.between?(1, 9) && b.between?(1, 9)
puts sum
else
puts "Wrong input, a and b should be integers within the 0..9 range."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment