程序界面如图所示,当单击“求解”按钮Command1时,在列表框List1中显示所有满足条件的组合。
程序代码如下,请在划线处填上合适的代码。
Dim a(0 To 9) As Integer
Private Sub Command1_Click()
Dim i, n, m As Integer
For i = 123 To 333
For n = 1 To 9
a(n) = 0
Next n
s = 0
call fenjie (i) ‘使用call调用自定义过程,下同
call fenjie (2 *i)
call fenjie (3 *i)
For m = 1 To 9
s =
Next m
If s = 9 Then List1.AddItem i & “ ” & 2 * i & “ ” & 3 * i
Next i
End Sub
Sub fenjie(x As Integer) ‘自定义过程,将3位数分解并修改对应下标元素的值
a(x Mod 10) = 1
a(x \ 100) = 1
End Sub