3个回答
2013-06-06
展开全部
Private Sub Form_Click()
Dim a As Integer, b As Integer, c As Integer
a = InputBox("请输入一个整数:")
b = InputBox("请再输入一个整数:")
c = InputBox("请输入最后一个整数:")
Print a, b, c
If a < b Then
d = a
a = b
b = d
End If
If a < c Then
d = a
a = c
c = d
End If
If b < c Then
d = b
b = c
c = d
End If
Print a, b, c
End Sub
Dim a As Integer, b As Integer, c As Integer
a = InputBox("请输入一个整数:")
b = InputBox("请再输入一个整数:")
c = InputBox("请输入最后一个整数:")
Print a, b, c
If a < b Then
d = a
a = b
b = d
End If
If a < c Then
d = a
a = c
c = d
End If
If b < c Then
d = b
b = c
c = d
End If
Print a, b, c
End Sub
2013-06-06
展开全部
Private Sub Form_Click()
Dim d(), a As Single, b As Single, c As Single
a = InputBox("输入一个数:")
b = InputBox("输入一个数:")
c = InputBox("输入一个数:")
d = Array(a, b, c)
n = UBound(d)
For i = 0 To n - 1
For j = 0 To n - 1 - i
If d(j) < d(j + 1) Then
t = d(j): d(j) = d(j + 1): d(j + 1) = t
End If
Next j
Next i
For i = 0 To n: Print d(i);: Next i
End Sub
Dim d(), a As Single, b As Single, c As Single
a = InputBox("输入一个数:")
b = InputBox("输入一个数:")
c = InputBox("输入一个数:")
d = Array(a, b, c)
n = UBound(d)
For i = 0 To n - 1
For j = 0 To n - 1 - i
If d(j) < d(j + 1) Then
t = d(j): d(j) = d(j + 1): d(j + 1) = t
End If
Next j
Next i
For i = 0 To n: Print d(i);: Next i
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-06-06
展开全部
用冒泡法
For s = 1 To 3
For b = 1 To 3
If a(b) > a(b + 1) Then f = a(b): a(b) = a(b + 1): a(b + 1) = f
Next b
Next s
For s = 1 To 3
For b = 1 To 3
If a(b) > a(b + 1) Then f = a(b): a(b) = a(b + 1): a(b + 1) = f
Next b
Next s
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询