有如下程序:
Const N=-5
Const M=6
Dim a(N To M)As Integer
For i=LBound(a)To UBound(a)
a(i)= i
Next i
Print a(LBound(a));a(UBound(a))
运行后,输出结果为( )。
Const N=-5
Const M=6
Dim a(N To M)As Integer
For i=LBound(a)To UBound(a)
a(i)= i
Next i
Print a(LBound(a));a(UBound(a))
运行后,输出结果为( )。
举一反三
- 以下程序输出的结果是: Private Sub Form_Activate() Dim a a=Array(1,2,3,4,5) For i=Lbound(((A) To Ubound(((A) A(i)=i*a(i) Next i Print i, Lbound(((A) , Ubound(((A) , a(i) End Sub
- 有如下程序:Constn=-5Constm=6Dima(nTom)AsIntegerFori=LBound(a,1)ToUBound(a,1)a(i)=iNextiPrinta(LBound(a,1));a(UBound(a,1))运行后输出的结果为()。
- 使用数组x输出10个1-100之间的随机整数(包括1和100),下列命令中正确的是:( ) A: Dim x(9) As Integer For i = 1 To UBound(x) x(i) = Int(Rnd() * 100 + 1) Print x(i); Next B: Dim x(9) As Integer For i = 0 To UBound(x) x(i) = Rnd(10) Print x(i); Next C: Dim x(9) As Integer For i = 0 To UBound(x) x(i) = Int(Rnd() * 100 ) Print x(i); Next D: Dim x(9) As Integer For i = 0 To UBound(x) x(i) = Int(Rnd() * 100 + 1) Print x(i); Next
- 执行下面程序段后,输出的结果为( )。 Dim m(5) As Integer s = 0 For i = 0 To 5 m(i) = 5 Next i For j = 0 To 5 s = s + m(j) Next j Print s
- 下列程序段的执行结果为_____。 Dim M(10),N(10) I=3 for T=1 To 5 M(T)=T N(I)=2*I+T Next T print N(I);M(I)