谁能给我讲一下这题的思路啊?急啊~~
从键盘输入5个数,输出最大值和最小值~
存到一个数组里,用任何一种排序法都可以做的
楼上比知道是不是B5……给你改了下。。。
Private Sub command1_click()
Dim a(4) As Integer
Dim i As Integer
Print "原来的五位数是:"
For i = 0 To 4
a(i) = Val(InputBox("请输入数据:"))
Print a(i);
Next i
max = a(0):min = a(0)
For i = 1 To 4
If a(i) > max Then
max = a(i)
ElseIf a(i) < min Then
min = a(i)
End If
Next i
Print "最大数是:";max;"最小数是:";min
End Sub
[此贴子已经被作者于2007-5-6 14:10:17编辑过]