3下面程序的运行结果是( )。Option Base 1Private Sub Commandl_Crick()Dimx,y(3,3)x=Array(1,2,3,4,5,6,7,8,9)Fori=1 To 3Forj=1 To 3y(i,j)=(i*j)If(j>=i)Then Printy(i,j);NextjPrintNextiEnd SubA.B.C.D.
3下面程序的运行结果是( )。
Option Base 1
Private Sub Commandl_Crick()
Dimx,y(3,3)
x=Array(1,2,3,4,5,6,7,8,9)
Fori=1 To 3
Forj=1 To 3
y(i,j)=(i*j)
If(j>=i)Then Printy(i,j);
Nextj
Nexti
End Sub
A.
B.
C.
D.
相关考题:
下面程序段的运行结果是【 】。Option Base 1Private Sub Swap (a() As IntegFor I=1 to 10\2t=a(I)a(I)=a(10-I+1)a(10-I+1)=tNext IEnd SubPrivate Sub Form_Click()Dim x(10) As IntegerFor I=1 to 10x(I)=I*2Next ISwap x()For I=1 to 10Print x(I)Next IEnd Sub
以下定义数组或给数组元素赋值的语句中,正确的是A.Dim x%(2) x(1)="等级考试"B.Dim x(3), y(3)As Integer x(0)=1:y=xC.Dim x x=Array(0,1,2)D.Dim x(3)As Integer x=Array(0,1,2)
阅读下列程序。Option Base 1Private Sub Form CliCk()Dim x(3,3)For j=1 to 3For k=1 to 3If j=k then x(j,k)=1If j<> k then x(j,k)=3Next kNext jCall fun(x())End SubPrivate Sub fun(a())For j=1 to 3For k=1 to 3Print a (j,k);Next kNext jEnd Sub运行程序时,输出的结果是【 】。
在窗体上面一个名称为Commandl的命令按钮,然后编写如下程序: Option.Base 1 Private Sub Command1_Click() Dim a As Variant a=Array(1,2,3,4,5) Sum = 0 For i = 1 To 5 Sum=Sum+a(i) Next i x=Sum/5 For i=1 To 5 If a(i) >x Then Print a(i); Next i End Sub 程序运行后,单击命令按钮,在窗体上显示的内容是A.1 2B.1 2 3C.3 4 5D.4 5
下面程序的运行结果是 Private Sub Command1_Click() x=1:y=1 For i=1 To 3 x=x+y:y=y+x Next i:print x,y End SubA.6 6B.5 8C.13 21D.34 35
下面程序运行后,y的值是 。 Dim x%,y% x = Int(Rnd) + 3 If x ^ 2 = 9 Then y = x ^ 2 - 2 If x ^ 2 > 8 Then y = x ^ 2 + 1
下面程序段运行后,显示的结果是 。 Dim x% If x Then MsgBox(x) Else MsgBox(x + 1)A.1B.0C.2D.-1E.显示出错信息