=begin
Solicitar una opción del menú.
1 Muestra el número tal cual
2 Aumenta en 1 el número
3 Disminuye en 1 el número
4 Salir del programa
=end
begin
puts "e[He[2J"
puts "UNIVERSIDAD NACIONAL AUTONOMA DE MEXICO"
puts "INTRODUCCION A LA PROGRAMACION"
puts "MENU DE INCREMENTO Y DECREMENTO"
puts "==============================="
puts "1. Muestra el mismo número que va a teclear."
puts "2. Adiciona 1 al número que va a teclear"
puts "3. Reduce en 1 el número que va a teclear"
puts "4. Salir"
opcion = gets.chomp
case opcion
when '1'
puts "Ingrese el número:"
numero = gets.to_f
puts "Tecleo el número #{numero}"
puts "Presione [Enter] para continuar"
gets.chomp
when '2'
puts "Ingrese el número:"
numero = gets.to_f
puts "Su número + 1 es #{numero+1}"
puts "Presione [Enter] para continuar"
gets.chomp
when '3'
puts "Ingrese el número:"
numero = gets.to_f
puts "Su número - 1 es #{numero-1}"
puts "Presione [Enter] para continuar"
gets.chomp
end
end while opcion !="4"
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}