for i=1to4 x=1 for j=1to3 x=3 for k=1to2 x=x+6
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/11/07 16:46:37
for i=1to4 x=1 for j=1to3 x=3 for k=1to2 x=x+6
private sub form clickfor i=1to4 x=1 for j=1to3 x=3 for k=1to2 x=x+6next jnext iprint xend sub 请问输出结果是多少?最好附带解释说明
private sub form clickfor i=1to4 x=1 for j=1to3 x=3 for k=1to2 x=x+6next jnext iprint xend sub 请问输出结果是多少?最好附带解释说明
在j循环时被初始化x=3,所以只有最后一次循环才决定x的值,即i=4,j=3时,k循环x+3两次,得x=9
整理一下你的代码
For i = 1 To 4
For j = 1 To 3
x = 3
For k = 1 To 2
x = x + 3
.i
X=3,所以只考虑最后外循环即i=4,j=3时,执行内循环x=3+3+3=9
整理一下你的代码
For i = 1 To 4
For j = 1 To 3
x = 3
For k = 1 To 2
x = x + 3
.i
X=3,所以只考虑最后外循环即i=4,j=3时,执行内循环x=3+3+3=9
for i=1to4 x=1 for j=1to3 x=3 for k=1to2 x=x+6
private sub command_click() for i=1 to4 x=3 for j=1to3 for k
for next for i=1 to 4 x=4 for j=1 to 3 x=3 for k=1 to 2 x=x+
VB x=0 for i =0 to 4,for j =0 to i-1,x=x+(i+j-1),exit for ne
for(x=1;x
解一道vb函数题,private sub command1 _click(),for i =1to4 ,for j =1
假定有以下程序段 n=0 for i=1to4 for j =3 to -1 step -1 n=n+1 next j
for i=1 to 4 x=4 for j=1 to 3 x=3 fork=1 to 2 x=x+6 next k n
Private Sub Command1_Click() For i = 1 To 4 x = 4 For j = 1
Sum=0 For1=1to3 Forj=i to 4 For k=j to 5 Sum=sum+1 Nex k Nex
n=0,for i=1to3,for j=-4 to-1,n=n+1,next j,next i.运行完后n的值?
Dim x(3,5) As Integer For i = 1 To 3 For j = 1 To 5 x(i,j) =