Private Sub Command1_Click() s = 0 Do s = (s + 1) * (s + 2) Number = Number + 1 Loop Until s >= 30 PPrivate Sub Command1_Click()s = 0Dos = (s + 1) * (s + 2)Number = Number + 1Loop Until s >= 30Print Number,sEnd Sub这个程序是怎么执行的?
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 21:54:02
Private Sub Command1_Click() s = 0 Do s = (s + 1) * (s + 2) Number = Number + 1 Loop Until s >= 30 PPrivate Sub Command1_Click()s = 0Dos = (s + 1) * (s + 2)Number = Number + 1Loop Until s >= 30Print Number,sEnd Sub这个程序是怎么执行的?
Private Sub Command1_Click() s = 0 Do s = (s + 1) * (s + 2) Number = Number + 1 Loop Until s >= 30 P
Private Sub Command1_Click()
s = 0
Do
s = (s + 1) * (s + 2)
Number = Number + 1
Loop Until s >= 30
Print Number,s
End Sub
这个程序是怎么执行的?
Private Sub Command1_Click() s = 0 Do s = (s + 1) * (s + 2) Number = Number + 1 Loop Until s >= 30 PPrivate Sub Command1_Click()s = 0Dos = (s + 1) * (s + 2)Number = Number + 1Loop Until s >= 30Print Number,sEnd Sub这个程序是怎么执行的?
从S=0时开始,
当S=0时,执行s = (s + 1) * (s + 2),则S=1*2=2
当S=2时,执行s = (s + 1) * (s + 2),则S=3*4=12
当S=12时,执行s = (s + 1) * (s + 2),则S=13*14=182
Number = Number + 1
执行三次
Number =3
也就是结果为3 182