1个回答
展开全部
Option Explicit
Option Base 1
Private Sub Form_click()
Randomize
Dim i As Integer, j As Integer, temp As Integer
Dim a(30) As Integer
For i = 1 To 30
a(i) = Int(90 * Rnd + 10)
Next i
For i = 1 To 29
For j = i + 1 To 30
If a(i) > a(j) Then
temp = a(i)
a(i) = a(j)
a(j) = temp
End If
Next j
Next i
For i = 1 To 30
If a(i) Mod 2 <> 0 Then Print a(i):
Next i
End Sub
Option Base 1
Private Sub Form_click()
Randomize
Dim i As Integer, j As Integer, temp As Integer
Dim a(30) As Integer
For i = 1 To 30
a(i) = Int(90 * Rnd + 10)
Next i
For i = 1 To 29
For j = i + 1 To 30
If a(i) > a(j) Then
temp = a(i)
a(i) = a(j)
a(j) = temp
End If
Next j
Next i
For i = 1 To 30
If a(i) Mod 2 <> 0 Then Print a(i):
Next i
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询