[填空题] 下面程序段的输出结果为 (6) 。 Dim S1(5) As Integer,S2(5) As Integer,S3(5) As Integer N=4 For I=1 To N

20 查阅

[填空题] 下面程序段的输出结果为 (6)

Dim S1(5) As Integer,S2(5) As Integer,S3(5) As Integer

N=4

For I=1 To N

S1(I)=I

L=N+1-I

S2(I)=L

Next I

S3(5)=0

For K=1 To N

S3(K)=S1(K)*S2(K)

S3(5)=S3(5)+S3(K)

Next K

Print S1(3); S1(5); S1(2)

Print S2(4); S3(1); S3(5)

参考答案:

“3 0 21 4 20”

本题看似复杂实际应用知识点较少,仅是赋值运算。循环的出现没有难点,细心代入原程序寻找相应数组即可。

计算机考试