a = array(1,2,3,4,5):for k = 1 to 4:s = s + a(k)中的s = s + a(k)这条语句是什么意思?窗体上有一个命令按钮,命令按钮的单击事件如下:Private Sub command1_click()dim aa = array(1,2,3,4,5)for k = 1 to 4 s = s + a(k)nextprint
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/28 22:12:38
a = array(1,2,3,4,5):for k = 1 to 4:s = s + a(k)中的s = s + a(k)这条语句是什么意思?窗体上有一个命令按钮,命令按钮的单击事件如下:Private Sub command1_click()dim aa = array(1,2,3,4,5)for k = 1 to 4 s = s + a(k)nextprint
a = array(1,2,3,4,5):for k = 1 to 4:s = s + a(k)中的s = s + a(k)这条语句是什么意思?
窗体上有一个命令按钮,命令按钮的单击事件如下:
Private Sub command1_click()
dim a
a = array(1,2,3,4,5)
for k = 1 to 4
s = s + a(k)
next
print s
end sub
运行程序后,单击命令按钮,输出结果是
A)10 B)14 C)15 D)120
------------------------------>>>>>>具体解题思路,
尤其是a = array(1,2,3,4,5)
for k = 1 to 4
s = s + a(k)中的s = s + a(k)这条语句是什么意思?
a = array(1,2,3,4,5):for k = 1 to 4:s = s + a(k)中的s = s + a(k)这条语句是什么意思?窗体上有一个命令按钮,命令按钮的单击事件如下:Private Sub command1_click()dim aa = array(1,2,3,4,5)for k = 1 to 4 s = s + a(k)nextprint
这是考你对数组的理解
a = array(1,2,3,4,5)这句后
a[0]=1;
a[1]=2;
.
a[4]=5;//注,没有a[5]了哦
s=s+a(k),就是把s+a(k)后的值,再赋给s