编一个vb 允许输入十个数字 从十个数中求出最大值 然后在窗体显示最大值 麻烦您写一下vb代码
1个回答
展开全部
怎么刚才看到个一样的。。。
'添加窗体Form1,按钮Command1,然后添加如下代码:
Private Sub Command1_Click()
Dim a(9), i, temp As Integer
For i = 0 To 9
a(i) = Val(InputBox("请输入第" & i + 1 & "个数:"))
Print a(i);
Next
temp = a(0)
For i = 0 To 9
If a(i) > temp Then temp = a(i)
Next
Print "最大数为:" & temp
End Sub
'添加窗体Form1,按钮Command1,然后添加如下代码:
Private Sub Command1_Click()
Dim a(9), i, temp As Integer
For i = 0 To 9
a(i) = Val(InputBox("请输入第" & i + 1 & "个数:"))
Print a(i);
Next
temp = a(0)
For i = 0 To 9
If a(i) > temp Then temp = a(i)
Next
Print "最大数为:" & temp
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询