下列程序的运行结果为
Dim a(-1 To 6)
For i=LBound(a, 1) To UBound(a, 1)
a(i) =i
Next i
Print a(LBound(a, 1) ) ; a(UBound(a, 1) ) ( )。
A.0 0
B.-5 0
C.-1 6
D.0 6
第1题:
下列程序的运行结果为 Dim a(-1 To 6) For i=LBound(a,1)To UBound(a,1) a(i) = i Next i Print a (LBound(a,1));a(UBound(a,1))
A.0 0
B.-5 0
C.-1 6
D.0 6
第2题:
下面程序运行后,单击命令按钮,输出的结果是______。
Private Sub Command1_Click()
Dim a%(1 To 5),i%,s
For i=1 To 5
a(i) =i
Next
s=Fun(A)Print "s=";s;
End Sub
Function Fun(a() As Integer)
Dim t,i%
t=1
For i=LBound(A)To UBound(A)t=t*a(i)
Next
Fun=t
End Function
第3题:
有如下程序: Const n = -5 Const m = 6 Dim a(n To m) As Integer For i = LBound(a, 1) To UBound(a, 1) a(i) = i Next i Print a(LBound(a, 1)); a(UBound(a, 1)) 运行后输出的结果为()。
A.0 0
B.-5 0
C.-5 6
D.0 6
第4题:
下面运行程序后,单击命令按钮,输出的结果是【 】。
Private Sub Command1_Click()
Dim a%(1 To 4),b%(3 To 6),i%,s1,s2
For i=1 To 4
a(i)=i
Next
For i=3 To 6
b(i)=i
Next
s1.= Fun(a)
s2 =Fun(b)
Print "s1 ="; s1; "s2 ="; s2
End Sub
Function Fun( a( ) As Integer)
Dim t, i%
t=1
For i = LBound(A)To UBound(a)
t=t * a(i)
Next
Fun=t
End Function
第5题:
A.12345
B.01234
C.54321
D.43210