4个回答
展开全部
Private Sub Command1_Click()
Dim a As Integer, b As Integer, c As Integer
Dim max As Integer, min As Integer
a = Val(InputBox("输入第1个整数", "Input"))
b = Val(InputBox("输入第2个整数", "Input"))
c = Val(InputBox("输入第3个整数", "Input"))
max = a
If b > max Then max = b
If c > max Then max = c
min = a
If b < min Then min = b
If c < min Then min = c
Print max, a + b + c - max - min, min
End Sub
Dim a As Integer, b As Integer, c As Integer
Dim max As Integer, min As Integer
a = Val(InputBox("输入第1个整数", "Input"))
b = Val(InputBox("输入第2个整数", "Input"))
c = Val(InputBox("输入第3个整数", "Input"))
max = a
If b > max Then max = b
If c > max Then max = c
min = a
If b < min Then min = b
If c < min Then min = c
Print max, a + b + c - max - min, min
End Sub
展开全部
Dim i, j As Integer
Dim a(1 To 3) As Integer
Dim maxa As Integer
For i = 1 To 3
a(i) = Val(InputBox("请输入第" & i & "个数"))
Next i
For i = 1 To 3
maxa = a(i)
For j = i To 3
If maxa < a(j) Then
maxa = a(j)
a(j) = a(i)
a(i) = maxa
End If
Next j
Next i
For i = 1 To 3
Print a(i)
Next i
Dim a(1 To 3) As Integer
Dim maxa As Integer
For i = 1 To 3
a(i) = Val(InputBox("请输入第" & i & "个数"))
Next i
For i = 1 To 3
maxa = a(i)
For j = i To 3
If maxa < a(j) Then
maxa = a(j)
a(j) = a(i)
a(i) = maxa
End If
Next j
Next i
For i = 1 To 3
Print a(i)
Next i
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Option Base 1
Dim a(3) As String
Dim i As Integer
Dim j As Integer
Dim x As String
Private Sub Command1_Click()
For i = 1 To 3
a(i) = InputBox("请输入第" & i & "个值")
Next i
For i = 1 To 2
For j = i + 1 To 3
If a(i) > a(j) Then
b = a(i)
a(i) = a(j)
a(j) = b
End If
Next j
Next i
For i = 1 To 3
Print Tab((i * 5) - 1); a(i);
Next i
End Sub
Dim a(3) As String
Dim i As Integer
Dim j As Integer
Dim x As String
Private Sub Command1_Click()
For i = 1 To 3
a(i) = InputBox("请输入第" & i & "个值")
Next i
For i = 1 To 2
For j = i + 1 To 3
If a(i) > a(j) Then
b = a(i)
a(i) = a(j)
a(j) = b
End If
Next j
Next i
For i = 1 To 3
Print Tab((i * 5) - 1); a(i);
Next i
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
使用一个输入框的话就需要确定3个数字的分隔符,然后用split函数把inputbox的字符串拆开。
如果使用三个字符串可以这样写:
dim
a,
b,
c,
d,
e
as
single
a
=
val(inputbox("请输入第一个数字"))
b
=
val(inputbox("请输入第二个数字"))
c
=
val(inputbox("请输入第三个数字"))
d
=
a
+
b
+
c
e
=
d
/
3
msgbox
"和值:"
&
d
&
"
"
&
"平均值:"
&
e
如果使用三个字符串可以这样写:
dim
a,
b,
c,
d,
e
as
single
a
=
val(inputbox("请输入第一个数字"))
b
=
val(inputbox("请输入第二个数字"))
c
=
val(inputbox("请输入第三个数字"))
d
=
a
+
b
+
c
e
=
d
/
3
msgbox
"和值:"
&
d
&
"
"
&
"平均值:"
&
e
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询