Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. input = gets.chomp.split(' ')
  2.  
  3. while input != nil
  4. if input[1] == "+"
  5. puts input[0].to_i + input[2].to_i
  6. elsif input[1] == "-"
  7. puts input[0].to_i - input[2].to_i
  8. elsif input[1] == "*"
  9. puts input[0].to_i * input[2].to_i
  10. else
  11. puts input[0].to_i / input[2].to_i
  12. end
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement