...从键盘输入这10个整数,找出其中的最大数和最小数并输出。求代码_百...
发布网友
发布时间:2024-09-26 21:58
我来回答
共1个回答
热心网友
时间:2024-10-05 05:59
Sub main()
Dim a(10)
Dim i, max, min
max = -32766
min = 32766
For i = 0 To 9
a(i) = CInt(InputBox("输入一个数:", "例子", i))
If a(i) > max Then max = a(i)
If a(i) < min Then min = a(i)
Next i
MsgBox "最大数是:" & max & ", 最小数:" & min
End Sub
热心网友
时间:2024-10-05 06:00
Sub main()
Dim a(10)
Dim i, max, min
max = -32766
min = 32766
For i = 0 To 9
a(i) = CInt(InputBox("输入一个数:", "例子", i))
If a(i) > max Then max = a(i)
If a(i) < min Then min = a(i)
Next i
MsgBox "最大数是:" & max & ", 最小数:" & min
End Sub