vb中for语句
答案:1 悬赏:30 手机版
解决时间 2021-10-10 03:16
- 提问者网友:呐年旧曙光
- 2021-10-09 02:38
vb中for语句
最佳答案
- 五星知识达人网友:毛毛
- 2021-10-09 03:14
Private Sub Command1_Click() Dim x(0 To 5) As Integer, aryX(0 To 5) As Integer, i, j, k As Integer Dim mins(0 To 32) As Integer, maxone As Integer For i = 0 To 5 x(i) = Int(Val(InputBox("请输入第" & i + 1 & "个数字"))) Next i For j = 0 To 32 For k = 0 To 5 aryX(k) = Abs(j + 1 - x(k)) Next k mins(j) = Min(aryX()) Next j maxone = Max(mins) MsgBox "最终结果是" & maxone End Sub Private Function nonum(numeric As Integer) If numeric > 0 Then nonum = numeric Else nonum = 65535 End If End Function Private Function Min(ary() As Integer) Dim amin As Integer For i = LBound(ary) To UBound(ary) If amin > ary(i) Then amin = ary(i) End If Next Min = amin End Function Private Function Max(ary() As Integer) Dim amin As Integer For i = LBound(ary) To UBound(ary) If amin < ary(i) Then amin = ary(i) End If Next Max = amin End Function
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯