编写如下程序: Dim num As Integer, r As Integer, n As Integer, i As Integer Dim arr(5) As Integer Private Sub Command1_Click() num =

admin2015-06-30  35

问题 编写如下程序:
Dim num As Integer, r As Integer, n As Integer, i As Integer
Dim arr(5) As Integer
Private Sub Command1_Click()
   num = 12:   r = 2
   Call sub1(num, r, n)
   For i = n To 1 Step -1
      Print arr(i);
   Next i
End Sub
Sub sub1(d As Integer, r A

选项 A、1  1  0  0
B、0  0  1  1
C、0  1  0  1
D、1  0  1  0

答案A

解析 sub1函数对全局数组arr元素赋初值,sub1函数参数传递均为默认的引用传递。因此执行完后n值被修改。Command1_Click()事件中的For循环对arr数组元素进行倒序输出。选A)。
转载请注明原文地址:https://kaotiyun.com/show/mfQp777K
0

最新回复(0)