Ver Mensaje Individual
  #4 (permalink)  
Antiguo 26/05/2010, 05:06
minette1988
 
Fecha de Ingreso: febrero-2010
Mensajes: 258
Antigüedad: 14 años, 2 meses
Puntos: 0
Respuesta: ordenar varios números ascendentemente

Esta forma ¿sería válida?,¿funcionaría correctamente?, el ejercicio me pide introducir los tres números por teclado:

Código vb:
Ver original
  1. a = InputBox("Introduce Numero 1:")
  2. b = InputBox("Introduce Numero 2:")
  3. c = InputBox("Introduce Numero 3:")
  4.  
  5. Option Explicit
  6. Dim a, b, c
  7. var = InputBox("Introduce tre números:")
  8. MsgBox(a, b, c)
  9. If (( a > b) && (a > c)) Then
  10.     If (b > c)
  11.      MsgBox(c, b, a)
  12.     Else
  13.          MsgBox(b, c, a)
  14. End If
  15. If (( b > a) && (b > c)) Then
  16.       If (a > c)
  17.          MsgBox(c, a, b)
  18.       Else
  19.            MsgBox(a, c, b)
  20. End If
  21. If (( c > a) && ( c > b)) Then
  22.      If ( a > b)
  23.         MsgBox(b, a, c)
  24.      Else
  25.           MsgBox(a, b, c)
  26. End If