Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input = gets.chomp.split(' ')
- while input != nil
- if input[1] == "+"
- puts input[0].to_i + input[2].to_i
- elsif input[1] == "-"
- puts input[0].to_i - input[2].to_i
- elsif input[1] == "*"
- puts input[0].to_i * input[2].to_i
- else
- puts input[0].to_i / input[2].to_i
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement