单选题 VB
题号 #1759393

有如下程序: 
Option Base ! 
Private Sub Command1_Click() 
Dim arr(10) 
arr=Array(10,35,28,90,54,68,72,90) 
For Each a In arr 
If a>50 Then 
Sum=Sum+a 
End If 
Next a 
End Sub 
运行上述程序时出现错误,错误之处是(  )。

进入在线模考

参考答案

A

答案解析

利用Array()函数对数组各元素赋值,声明的数组必须是可变数组或连圆括号都可省的数组,并且其类型只能是Variant。因此dim arr()时,括号中不能有数字。因此A)项是正确答案。

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考