-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ruby/prism] Rescue LoadError for ruby_parser as well
- Loading branch information
Showing
2 changed files
with
9 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b5e53e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def numero_intermedio(num1, num2)
Ordenar los números de menor a mayor
menor = [num1, num2].min
mayor = [num1, num2].max
Calcular el número intermedio
intermedio = menor + (mayor - menor) / 2.0
return intermedio
end
Solicitar al usuario que ingrese los números
print "Ingresa el primer número: "
num1 = gets.chomp.to_f
print "Ingresa el segundo número: "
num2 = gets.chomp.to_f