下面程序段输出的结果是(). Private Sub Command1_Click() Dim a(1 To 3, 4) As Integer Print LBound(a, 1), UBound(a, 1), LBound(a, 2), UBound(a, 2) End Sub
有如下程序: Dim arr(3,3) As Integer For j=1 To 3 For k=1 To 3 Arr(j,k)=(j-1)∗3+k Next k Next j For j=2 To 3 For k=2 To 3 Print arr(k,j); Next k Print Nextj 运行后,输出的结果是().
以下属于合法的数组元素是().
设执行以下程序段时依次输入11、33、55,执行结果为(). Dim a(4) As Integer, b(4) As Integer For K = 0 To 2 A(K + 1) = Val(InputBox("请输入数据")) B(3 - K) = a(K + 1) Next K Print b(K)
写出如下程序运行结果(). Function f(m As Integer) As Integer B= 1 Static c As Integer B= b + 1 C= c + 1 F= m ∗ b ∗ c End Function Private Sub Command1_Click() Dim a As Integer A= 2 Sum=0 For I = 1 To 3 Sum=sum+ f(a) Next I Print sum End Sub
下列程序运行后,输出的结果是(). Private Sub Command1_Click() Sum=0 S=0 For k=3 To 5 Call Multi(k,s) Sum=Sum+S Next k Print Sum End Sub Private Sub Multi(k,s) S=1 For j=l To k S=8∗j Next j End Sub
有如下函数过程: Function gys(ByVal X AS Integer, ByVal y AS Integer) AS Integer DO While y <> 0 Preminder = x / y X = y Y = preminder Loop Gys = x End Function 以下是调用该函数的事件过程,该程序的运行结果是(). Private Sub Command1_Click() Dim a AS Integer Dim b AS Integer A= 10 B= 2 X= gys(a,b) Print x End Sub
要想在过程调用后返回两个结果,下面的过程定义语句中合法().
下面过程定义语句中合法的是().
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() A= Val(InputBox("a = ")) Print fun1(A) End Sub Private Function fun1(b) If b > 0 Then Fun1 = 10 ElseIf b = 0 Then Fun1 = 9 Else Fun1 = 8 End If End Function 程序运行后,单击命令按钮,从键盘数据3,则窗体上显示的内容是().
有如下函数: Function Fee(x) Static y As Integer Y=y+1+x Fee=y End Function Private Sub Command1_Click() X=InputBox("",,0) For i=1 To 2 Pay=Fee(x) Next i Print pay End Sub 运行时从输入框输入变量X的值为10,输出结果为().
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Static x As Integer Cls Y = y + 2 X = x + 2 Print x, y End Sub 程序运行后,连续四次单击Command1按钮后,窗体上显示的是().
单击窗体中的按钮Command1后,下列程序的输出结果是(). Dim X AS Integer Private Sub Command1_Click() Call fun1 Print X End Sub Private Sub Form_Load() X=5 End Sub Public Sub fun1() Dim x AS Integer X=10 End Sub
在窗体上画一个名称为Commandl的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim a AS Single , b AS Single A= 4:b = 10 Sub1 A,b Print a;b End Sub Sub Sub1(x As Single, y As Single) T = x X = t/y Y = t Mod y End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是().
单击一次命令按钮,下列程序代码的执行结果为(). Privae Sub Command1_Click() Dim a As Integer,b As Integer,c As Integer A=2:b=3:c=4 Print P2(c,b,a) End Sub Private Function P1(x As Integer,y As Integer) P1=2∗x+y+3∗z End Function Private Function P2(x As Integer,y As Integer,z As Integer) P2=P1(x,y)+x End Function