• 2021-04-14
    中国大学MOOC: 数组a是个整数数组且已有数据,如要在a中查找InputBox中输入的数字,并输出其下标。程序如下,请在_________处填入适当的内容,完善程序。 Dim i%, idx%, key% key = Val(InputBox("输入要查找的数字")) idx = -1 For i = 0 To UBound(a) If a(i) = key Then _________ Exit For End If Next If idx >= 0 Then MsgBox ("下标为" & idx) Else MsgBox ("找不到此数字") End If
  • 举一反三