Skip to content

Instantly share code, notes, and snippets.

/playing.rb Secret

Created April 22, 2016 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/ff615f71bfbf9822732096e2472e3fbb to your computer and use it in GitHub Desktop.
Save anonymous/ff615f71bfbf9822732096e2472e3fbb to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
input = gets.chomp.split(/ /).map(&:to_i)
a = input[0]
b = input[1]
sum = a + b
if a.between?(1, 9) && b.between?(1, 9)
puts sum
else
puts "Wrong input, a and be 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