VB题目: 下列车程序段的执行结果是什么? private sub form_click() dim i as integer,j as integer,
VB题目:下列车程序段的执行结果是什么?privatesubform_click()dimiasinteger,jasinteger,sasintegerfori=8to...
VB题目:
下列车程序段的执行结果是什么?
private sub form_click()
dim i as integer,j as integer, s as integer
for i=8 to 6 step -1
s=0#
for j = i to 5 step -1
s=s+i*j
next j
next i
print s
end sub
答案是66,我要详细过程啊,谢谢 展开
下列车程序段的执行结果是什么?
private sub form_click()
dim i as integer,j as integer, s as integer
for i=8 to 6 step -1
s=0#
for j = i to 5 step -1
s=s+i*j
next j
next i
print s
end sub
答案是66,我要详细过程啊,谢谢 展开
2个回答
展开全部
像这样跟踪一下变量的值就可以了:
Private Sub form_click()
Dim i As Integer, j As Integer, s As Integer
For i = 8 To 6 Step -1
Print "i="; i
s = 0#
Print "s="; s
For j = i To 5 Step -1
Print "j="; j
Print "s= s + i * j="; s; "+"; i; "*"; j; "=";
s = s + i * j
Print s
Next j
Print ".................."
Next i
Print "************************************"
Print s
End Sub
张志晨
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询