Private Sub Command1_Click()
Dim a(1 To 10) As Integer, b As Integer, c As Integer, d As Integer
Cls
For b = 1 To 10
a(b) = InputBox("input number", "input", 0)
Next b
c = a(1)
For b = 1 To 10
If a(b) > c Then
c = a(b)
d = b
End If
Next b
b = a(1)
a(1) = c
a(d) = b
For b = 1 To 10
If a(b) < c Then
c = a(b)
d = b
End If
Next b
b = a(10)
a(10) = c
a(d) = b
For b = 1 To 10
Print a(b)
Next b
End Sub
Dim a(1 To 10) As Integer, b As Integer, c As Integer, d As Integer
Cls
For b = 1 To 10
a(b) = InputBox("input number", "input", 0)
Next b
c = a(1)
For b = 1 To 10
If a(b) > c Then
c = a(b)
d = b
End If
Next b
b = a(1)
a(1) = c
a(d) = b
For b = 1 To 10
If a(b) < c Then
c = a(b)
d = b
End If
Next b
b = a(10)
a(10) = c
a(d) = b
For b = 1 To 10
Print a(b)
Next b
End Sub