对窗体编写如下代码: Option Base1 Private Sub Form_Key Press(Key Ascii AsInteger) a=Array(237,126,87,48,498) m1=a(1) m2=1 IfKey Ascii=13Then ForI=2To5 Ifa(I)>mlThen m1=a(j) m2=I EndIf NextI EndIf Printm1 Printm2 EndSub 程序运行后,按回车键,输出结果为()
设有如下程序: 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 程序运行后,单击窗体,则在窗体上显示的是()
下列程序的执行结果为________Option Base 0Private Sub Command1_Click()Dim aa = Array(a, b, c, d, e, f, g)Print a(1); a(3); a(5)End sub
设有如下声明语句: Option Base 1 Dim arr(3,-1 To 4) As Integer 则数组arr中数组元素的个数是( )
Option Base 1Private Sub Command1_Click()Dim a$(), s$s = InputBox(\请输入用英文逗号分开的数据\)a = Split(s, \,\)Print a(Ubound(a)+Lbound(a)-1)End Sub程序运行后,单击命令按钮,在输入对话框中输入12,A,2,b,c则输出结果是()。
下列程序:Option Base 1Private Sub Form_Click()Dim a(5,5)For i = 1 To 5For j = 1 To 5k = k + 1a (i,j)= kNext jNext iFor i = 1 To 5s = s + a (i,i)Next iPrint sEnd Sub运行时的输出结果是( )。
如果有声明Option base 1, Dim arr(3,3),则该数组共有( )个元素。
设有数组声明语句,定义的数组a为_______维数组,数组元素个数为_______。 Option base 1 Dim a()
下面的程序用“冒泡”法将数组a中的10个整数按升序排列,请将程序补充完整。 Option Base 1 Private Sub Command1_Click() Dim a a=Array(678,45,324,528,439,387,87,875,273,823) For i=【 】 For j=【 】 If a(i)【 】a(j)Then a1=a(i) a(i)=a(j) a(j)=a1 End If Next j Next i For i=1 To 10 Print a(i) Next i End Sub
在“声明”段有语句Option Base 1,那么用如下语句声明的数组a包含的元素个数为()。 Dim a(-1 To 3, 3, 4)
在窗体上画一个名为Command1的命令按钮,然后编写如下程序: Option Base 1 Private Sub Command1_ Click()Dim arrarr = Array(358, 32, 46, 73, 23, 59, 26, 91, 583, 12)For i = ______ For j = ______ If arr(i) >= arr(j) Then a = arr(j
在窗体上画一个名称为Command1的命令按钮。编写如下程序: Option Base1 Private Sub Command1_Click() Dim a(10) As Integer For i=1 To 10 a(i)=i Next Call swap((11) ) For i=1 To 10 Print a(i); Next End Sub Sub swap(b()As Integer
以下的输出结果是 Option Base 1 Private Sub Command1_Click()Dim a(),p(3)
有如下程序:Option Base 1Private Sub Form Click()Dim arr,SumSum=0 arr=Array(1,3,5,7,9,11,13,15,17,19)For i=1 To 10If arr(i)/3=arr(i)//3 ThenSum=Sum+arr(i) En
在窗体上画一个名为Command1的命令按钮,然后编写如下程序: Option Base 1 Private Sub Command1_ Click() Dim arr arr = Array(358, 32, 46, 73, 23, 59, 26, 91, 583, 12) For i = ______ For j = ______ If arr(i) >= arr(j) Thena = arr
以下程序的功能是:将一维数组A中的100个元素分别赋给二维数组B的每个元素并打印出来,要求把A(i)到A(10)依次赋给B(1,1)到B(1,10),把A(11)到A(20)依次赋给B(2,1)到B(2,10),……,把A(91)到A(100)依次赋给B(10,1)到B(10,10)。请填空。Option Base 1Private Sub Form_Click()Di
运行下面程序,如果连续三次单击命令按钮之后,A数组共有() 个元素;数组元素A(2)的值是(),A(5)的值是()Option ExplicitOption Base lPrivate Sub Command1_Click()Static A() As Integer,N As IntegerDim I As Integer,K As IntegerK=NN=N+2ReDim Preserve A
以下程序的功能是,产生10个0~1000的随机整数,放入数组Art中,然后输出其中的最大值。请填空。 Option Base 1 Private Sub Form Click() Dim Arr(10)As Integer Dim Max As Integer Randomize For i=1 To 10 Arr(i)=Int(Rnd*1000) Next i Max= (14) For i=
窗体上有一个名称为Combo1的组合框, 其初始内容为空,有一个名称为Command1、标题为“添加项目”的命令按钮。程序运行后,如果单击命令按钮,会将给定数组中的项目添加到组合框中,如图所示。请填空。 Option Base 1 Private Sub Command 1_ Click(Dim city As Variant city=_【6】_("北京","天津","上海","武汉","重庆
4、以下程序的运行结果为()。 Option Base 1 Private Sub command1_click() Dim a(10), p(3) As Integer k = 5 For i = 1 To 10 a(i) = i Next i For i = 1 To 3 p(i) = a(i * i) Next i For i = 1 To 3 k = k + p(i) * 2 Next i Print k End Sub
以下程序的功能是:将一维数组A中的100个元素分别赋给二维数组B的每个元素并打印出来,要求把A(1)~A(10)依次赋给B(1,1)~B(1,10),把A(11)~A(20)依次赋给B(2,1)~B(2,10),……,把A(91)~A(100)依次赋给B(10,1)~B(10,10)。请填空。 Option Base 1 Private Sub Form_Click() Dim i As Inte
阅读程序: Option Base1 Private Sub Form_Click() Dim a(3)As Integer Print“输入的数据是:”; For i=1 To 3 a(i)=InputBox(“输人数据”) Print a(i); Next Print If a(1) t=a(1) a(1)=a(2) a(2)=【8】 End If If a(2)>a(3) Then m=a
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序: Option Base 1 Private Sub Command1_Click() Dim a(10)As Integer For i=1 To 10a(i)=i Next Call swap(【13】 ) For i=1 To 10Print a(i); Next End Sub Sub swap(b()As Integer
在窗体上面两个名称分别为Command1和Command2、标题分别为“初始化”和“求和”的命令按钮。程序运行后,如果单击“初始化”命令按钮,则对数组a的各元素赋值;如果单击“求和”命令按钮,则求出数组a的各元素之和,并在文本框中显示出来。请填空。 Option Base 1 Dim a(3,2) As Integer Private Sub Command1_Click() For i=1 To