private sub command1_click( ) FOR a=1 TO 5 y=1 FOR b=1 TO 5
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/11 22:03:14
private sub command1_click( ) FOR a=1 TO 5 y=1 FOR b=1 TO 5 FOR c=1 TO 5 y=y+c NEXT c NEXT b NEXT a
vb多重循环 这题y=1是什么时候带进去的 怎么算出76?
vb多重循环 这题y=1是什么时候带进去的 怎么算出76?
Private Sub command1_click()
For a = 1 To 5
y = 1
For b = 1 To 5
For c = 1 To 5
y = y + c
Next c
Next b
Next a
Print y
End Sub
'因为y=1在循环a后面 所以
'这个题就相当于 y= (1+2+3+4+5){循环C控制} * 5{循环B控制}+1
'即 15 *5+1=76
再问: 如果是按照顺序执行 不是先执行a=1循环 然后y=1...接着再执行b=1循环 然后完整执行c循环……这题我对循环的顺序不是很清楚……能否再详解?谢谢
For a = 1 To 5
y = 1
For b = 1 To 5
For c = 1 To 5
y = y + c
Next c
Next b
Next a
Print y
End Sub
'因为y=1在循环a后面 所以
'这个题就相当于 y= (1+2+3+4+5){循环C控制} * 5{循环B控制}+1
'即 15 *5+1=76
再问: 如果是按照顺序执行 不是先执行a=1循环 然后y=1...接着再执行b=1循环 然后完整执行c循环……这题我对循环的顺序不是很清楚……能否再详解?谢谢
private sub command1_click( ) FOR a=1 TO 5 y=1 FOR b=1 TO 5
Private Sub Command1_Click() For i = 1 To 3 For j = i To 1 a
1)private sub command1_click() x=10:y=0 for i=1 to 5 do x=x-
Private Sub Command1_Click() For i = 1 To 3 For j = 1 To i F
Private Sub Command1_Click() For i = 1 To 4 x = 4 For j = 1
Private Sub Command1_Click() n = 0 For i = 1 To 3 For j = -4
Private Sub Command1_Click() x=0 n=InputBox("") For i=1 To n
SOS!Private Sub Command1_Click()/s=0/For j=1 To 20/If j Mod
Private Sub command1_click() Dim m(10) For k = 1 To 10 m(k)
Private Sub Command1_Click() Dim b,k For k=1 to 6 b=23+k Nex
Private Sub Command1_Click() For i=1 To 4 x=4 For j =1 To 3&
求解一道VB private sub command1_click() for i = 1 to 4 x=4 for j