展开全部
Sub test()
Dim Num As Long, Arr(1 To 10)
For n = 1 To UBound(Arr)
Num = Application.InputBox("请输入第:" & n & "个数字:", "数字输入窗口", Type:=1)
If Num = False Then Exit Sub
Arr(n) = Num
Next
For i = 1 To UBound(Arr) - 1
If Arr(i) < Arr(i + 1) Then
JG = Arr(i + 1)
Else
JG = Arr(i)
End If
Next
MsgBox "10数中最大数是:" & JG
End Sub
Dim Num As Long, Arr(1 To 10)
For n = 1 To UBound(Arr)
Num = Application.InputBox("请输入第:" & n & "个数字:", "数字输入窗口", Type:=1)
If Num = False Then Exit Sub
Arr(n) = Num
Next
For i = 1 To UBound(Arr) - 1
If Arr(i) < Arr(i + 1) Then
JG = Arr(i + 1)
Else
JG = Arr(i)
End If
Next
MsgBox "10数中最大数是:" & JG
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询