vb输入3个数求出他们的最大值最小值平均值
来源:百度知道 编辑:UC知道 时间:2024/05/21 12:02:00
Private Sub Command1_Click()
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim min, max As Integer
Dim q As Single
a = 11
b = 12
c = 14
min = a
max = a
If b > max Then
max = b
Else
If b < min Then min = b
End If
If c > max Then
max = c
Else
If c < min Then min = c
End If
q = (a + b + c) / 3
MsgBox "min " + CStr(min) + " max " + CStr(max) + " q " + CStr(q)
End Sub