Private Sub Command0_Click() Dim a(10, 10) For m = 2 To 4 For n = 4 To 5 a(m, n) = m * n Next n Nex

问题描述:

Private Sub Command0_Click() Dim a(10, 10) For m = 2 To 4 For n = 4 To 5 a(m, n) = m * n Next n Nex
答案是42.谁能帮我解析一下啊?谢谢!
Private Sub Command0_Click()
Dim a(10, 10)
For m = 2 To 4
For n = 4 To 5
a(m, n) = m * n
Next n
Next m
MsgBox a(2, 5) + a(3, 4) + a(4, 5)
End Sub
不好意思!谢谢啦~

这一题不必详细分析过程也可以得到结果,因为a(m, n) = m * n,所以a数组中的元素的值正好等于其两个下标的积,所以a(2, 5) + a(3, 4) + a(4, 5)=2*5+3*4+4*5=42.