vb编程,输入a,b,c,三个数,按从小到大显示

如题所述

自己添加一个Command1控件,代码如下:
Private Sub Command1_Click()
Dim a%, b%, c%, t%
a = InputBox("输入第一个值:")
b = InputBox("输入第二个值:")
c = InputBox("输入第三个值:")
If a > b Then
t = a: a = b: b = t
End If
If b > c Then
t = b: b = c: c = t
End If
If a > c Then
t = a: a = c: c = t
End If
Print a; "<"; b; "<"; c
End Sub
温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-03-26
?晕你们考试啊追问

替别人问的,这玩意咋整?

追答

声明四个变量,a,b,c
比较if a =b then
if C>a then
print "a,b,c"
elseif c<a then
print "c,a,b"
else
print "三数相等"
end if
end if
类似这样的。

相似回答