实现上述功能的VB代码如下,但加框处有错,请改正。
Private Sub Command1_Click()
Dim n As Integer,m As Integer
Dim a(1 To 50)As Integer
n= Val(Text1. Text)
m= Val(Text2. Text)
For i= 1 To n
Next i
s=0;j=0
Do While s <n
t=0
Do While t <m
t=t+ a(j)
Loop
a(j)=0
s=s+1
List1. Additem"第"+Str(s)+"次:"+Str(j)
Loop
End sub
应改为