展开全部
建Command1,代码如下。
================
Option Explicit
Private Sub Command1_Click()
Dim a As Integer, b As Integer, c As Integer, t As Integer
a = Val(InputBox("a=?"))
b = Val(InputBox("b=?"))
c = Val(InputBox("c=?"))
If a > b Then t = b: b = a: a = t
If a > c Then t = c: c = a: a = t
If b > c Then t = c: c = b: b = t
Print "从小到大:"; a; b; c
End Sub
================
Option Explicit
Private Sub Command1_Click()
Dim a As Integer, b As Integer, c As Integer, t As Integer
a = Val(InputBox("a=?"))
b = Val(InputBox("b=?"))
c = Val(InputBox("c=?"))
If a > b Then t = b: b = a: a = t
If a > c Then t = c: c = a: a = t
If b > c Then t = c: c = b: b = t
Print "从小到大:"; a; b; c
End Sub
展开全部
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
sub
form_click()
dim
a
as
integer,
b
as
integer,
c
as
integer
a
=
inputbox("请输入一个整数:")
b
=
inputbox("请输入一个整数:")
c
=
inputbox("请输入一个整数:")
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
a,
b,
c
end
sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
冒泡排序,
for i = 1 to 3
for j = 1 to i
if a>b then
d=a
a=b
b=d
endif
next
next
for i = 1 to 3
for j = 1 to i
if a>b then
d=a
a=b
b=d
endif
next
next
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询