学校考试VB数组,谁能帮帮我?
试题如下:A(1,3,5),B(2,4,8,9)求A+B>5的数有几个,并打印出来。哪位好心人帮帮我,谢谢啦。,
参考答案:楼上的是错的
我这个可以,调试过
Dim a, b As Variant, i, j As Integer
a = Array(1, 3, 5)
b = Array(2, 4, 8, 9)
For i = LBound(a) To UBound(a)
For j = LBound(b) To UBound(b)
If Val(a(i)) + Val(b(j)) > 5 Then
Print a(i); b(j)
End If
Next j
Next i