Dim arrInt()as Integer=New Integer(2){}
语句Dim arr(-3 To 5,2 To 6)As Integer定义的数组元素有()个。
设有如下程序: Option Base 0 Private Sub Form_Click() Dim a Dim i As Integer a = Array(1,2,3,4,5,6,7,8,9) For i = 0 To 3 Print a(5 – i); Next End Sub 程序运行后,单击窗体,则在窗体上显示的是()
下面程序段是利用For语句给数组a赋值,使a(1)=1,a(2)=3,a(3)=5,……,a(50)=99,则划线处的语句应该是()。 Dim a(1 to 50) As Integer For i=1 To 50 ______Next i
用下面语句定义的数组的元素个数是() Dim A (-4 to 6) As Integer
下列程序中 s = s + j 语句共执行了______次。Dim s As IntegerDim i As Integer, j As IntegerFor i = 1 To 10 Step 2For j = 1 To 5 Step 2s = s + jNext jNext iPrint s
有如下函数过程: Function secproc(x As Integer, y As Integer, z As Integer) secproc = 3 * y + z + 2 * x End Function Private Sub Command1_Click() Dim a As Integer, b As Integer, c As Integer a = 2: b = 3: c = 4 Print secproc(c, b, a) End Sub 该程序的运行结果是( )。
有如下函数过程:Function secproc(x As Integer, y As Integer, z As Integer)secproc = 3 * y + z + 2 * xEnd FunctionPrivate Sub Command1_Click()Dim a As Integer, b As Integer, c As Integera = 2: b = 3: c = 4Print secproc(c, b, a)End Sub该程序的运行结果是( )。
求1!+2!+……+10!的程序如下: Private Function s(x As Integer) f=1 For i=1 To x f=f*i Next s=f End Function Private Sub Command1_Click() Dim i As Integer Dim y As Long For i=1 To 10 _____________ Next Print y End Sub
写输出下面程序的运行结果 _ _。 Dim a() As Integer Private Sub Command1_Click() ReDim a(1 To 5) For i = 1 To 5 a(i) = i Next i ReDim a(1 To 10) For i = 6 To 10 a(i) = 2 * i Next i For i = 1 To 10 Print a(i); Next i End Sub
用语句Dim A (-3 To 5) As Integer定义的数组的元素个数是().
下列程序的执行结果是 _ ________ __ Dim a(5) As String Dim b As Integer Dim I As Integer For I = 0 To 5 a(I) = I + 1 Print a(I); Next I
下面程序运行结果第一行是 ,最后一行是 。 Private Sub Form_Click() Dim I As Integer, J As Integer, X(4, 3) As Integer For I = 1 To 3 For J = 1 To 2 X(I, J) = I + J Print X(I, J); Next j Print Next i Print X(I, J) End Sub
在Visual Basic 中Dim a ,b,c as integer和Dim a as integer, b as integer,c as integer相同。
下面程序的功能是找出 100 () Dim i As Integer, j As Integer Dim Sum As Single, c As Single For i=1 To 100 For j=_______________ Sum= i + j C= i – j If___________________________Then Print " 自然数对为: "; i , j End If Next j Next i End Sub
在窗体上画一个名称为Text1的文本框和一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim array1(10,10) As Integer Dim i,j As Integer For i=1 To 3 For j=2 To 4
设有以下函数过程: Function fun(a As Integer,b As Integer) Dim c As Integer If a<b The
有如下程序:Private Sub Form_Click() Dim i As Integer, Sum As Integer sum=0 For i=2 To 10 I
语句Dim Arr(-2 To 3)As Integer所定义的数组的元素个数为()。
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序代码: Option Base 1 Dim arr() As Integer Private Sub Command1_Click() Dim i As Integer, j As Integer Dim s As Integer ReDim arr(4, 2) s = 0 For i = 1 To 3 For j = 1 To 2 arr(i, j) = i + j Next j Next i ReDim Preserve arr(4, 4) For j = 3 To 4 arr(3, j) = j + 10 Next j For i = 1 To 4 s = s + arr(i, i) Next i Print s End Sub 程序运行过程中,当单击Command1时,输出结果为________。
单击命令按钮时,下列程序的执行结果是()。 Private Sub Command1_Click() Dim a As Integer,b As Integer,C As Integer a=3 b=4 c=5 Print SecProc(c,b,a) End Sub Function FirProc (x As Integer,y As Integer,z As Integer) FirProc
在窗体上有一个名称为Command1的命令按钮,并有如下事件过程和函数过程: Private Sub Command1_Click() Dim p as Integer p=m(1)+m(2)+m(3) Print p End Sub Private Function m(n As Integer) As Integer Static s As Integer For k=1 To n s=s+1
下列程序是将数组a的元素倒序交换,即第1个变为最后一个,第2个变为倒数第2个,设数组中有10个元素。完成下列程序。 Private Sub Backward(a())Dim i As Integer, Tmp As IntegerFor i=1 To 5 Tmp=a(i) ______ ______Next i End Sub
执行下列程序后,变量a的值为()。 Dim i As Integer Dim a As Integer a=0 For i=1 To 100 Step 2 a=a+1 Next i