Private Sub Form-Click() Dim a a = Array(1,2,3,4) j = 1 For i = 4 To 1 Step -1 s = s + a(i)Private Sub Form-Click() Dim a a = Array(1,2,3,4) j = 1For i = 4 To 1 Step -1s = s + a(i) * jj = j * 10Next IPrint sEnd Sub 1234.
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/15 21:25:36
Private Sub Form-Click() Dim a a = Array(1,2,3,4) j = 1 For i = 4 To 1 Step -1 s = s + a(i)Private Sub Form-Click() Dim a a = Array(1,2,3,4) j = 1For i = 4 To 1 Step -1s = s + a(i) * jj = j * 10Next IPrint sEnd Sub 1234.
Private Sub Form-Click() Dim a a = Array(1,2,3,4) j = 1 For i = 4 To 1 Step -1 s = s + a(i)
Private Sub Form-Click()
Dim a
a = Array(1,2,3,4)
j = 1
For i = 4 To 1 Step -1
s = s + a(i) * j
j = j * 10
Next I
Print s
End Sub 1234.
Private Sub Form-Click() Dim a a = Array(1,2,3,4) j = 1 For i = 4 To 1 Step -1 s = s + a(i)Private Sub Form-Click() Dim a a = Array(1,2,3,4) j = 1For i = 4 To 1 Step -1s = s + a(i) * jj = j * 10Next IPrint sEnd Sub 1234.
初始:
s=0
j=1
循环第一次i=4:
s=0+4*1=4
j=1*10=10
第二次i=3:
s=4+3*10=34
j=10*10=100
第三次i=2:
s=34+2*100=234
j=100*10=1000
第四次i=1:
s=234+1*1000=1234
j=1000*10=1000