Private Sub Form_Click() a = 1: b = a Do Until a >= 5 x = a * b Print b; x a = a + b b = b + a Loop
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/27 01:58:02
PrivateSubForm_Click()a=1:b=aDoUntila>=5x=a*bPrintb;xa=a+bb=b+aLoopPrivateSubForm_Click()a=1:b=aDoUn
Private Sub Form_Click() a = 1: b = a Do Until a >= 5 x = a * b Print b; x a = a + b b = b + a Loop
Private Sub Form_Click() a = 1: b = a Do Until a >= 5 x = a * b Print b; x a = a + b b = b + a Loop
Private Sub Form_Click() a = 1: b = a Do Until a >= 5 x = a * b Print b; x a = a + b b = b + a Loop
Private Sub Form_Click() 点击窗体触发click事件
a = 1 初始a=1
b = a
Do Until a >= 5 执行do循环 直到a大于等于5时退出循环
x = a * b
Print b; x
a = a + b
b = b + a
Loop
end sub
最后窗体上打印的是:
1 1
3 6