lunes, 3 de junio de 2013

Capturar y Ordenar

Un pequeño programa para capturar y ordenar numeros




Codigo:

Dim valores(1 To 10) As Integer

Private Sub Command1_Click()
Dim temp As Integer
For i = 1 To 10
valores(i) = InputBox(" valor :")
  Next i
End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Command3_Click()
Dim tem As Integer
 For x = 1 To 10
 For i = 1 To 9
   If valores(i) < valores(1 + i) Then
   temp = valores(i)
   valores(i) = valores(i + 1)
   valores(i + 1) = temp
   End If
   Next i
   Next x
End Sub

Private Sub Command4_Click()
List1.Clear


End Sub

Private Sub Command5_Click()
For x = 1 To 10
       List1.AddItem (valores(x))
    Next x
End Sub

Private Sub Command6_Click()
Dim tem As Integer
 For x = 1 To 10
 For i = 1 To 9
   If valores(i) > valores(1 + i) Then
   temp = valores(i)
   valores(i) = valores(i + 1)
   valores(i + 1) = temp
   End If
   Next i
   Next x
End Sub


No hay comentarios.:

Publicar un comentario