更多"阅读程序;
Option Base 1
Private Sub"的相关试题:
[单项选择]阅读程序: Option Base 1 Private Sub Form_Click( ) Dim arr Sum Sum=0 arr=Array(1,3,5,7,9,11,13,15,17,19) For i=1 TO 10 If arr(i)/3=arr(i)/3 Then Sum=Sum+art(i) End If Next i Print Sum End Sub 程序运行后,单击窗体,输出结果为
A. 13
B. 14
C. 27
D. 15
[单项选择]阅读程序:
Option Base 1
Private Sub Form_Click( )
Dim arr Sum
Sum=0
arr=Array(1,3,5,7,9,11,13,15,17,19)
For i=1 TO 10
If arr(i)/3=arr(i)/3 Then
Sum=Sum+art(i)
End If
Next i
Print Sum
End Sub
程序运行后,单击窗体,输出结果为
A. 13
B. 14
C. 27
D. 15
[单项选择]阅读程序:
Option Base 1
Private Sub Form Click( )
Dim arr,Sum
Sum= 0
arr=Array(1,3,5,7,9,11,13,15,17,19)
For i=1 To 10
If arr(i)/3=arr(i)/3 Then
Sum=Sum+arr(i)
End If
Next i
Print Sum
End Sub
程序运行后,单击窗体,输出结果为
A. 13
B. 14
C. 27
D. 15
[单项选择]设有如下程序
Option Base 1
Private Sub Command1_Click( )
Dim a(10)As Integer
Dim n As Integer
n=lnput Box(“输入数据”)
If n<10 Then
Call GetArray(a,n)
End If
End Sub
Private Sub GetArray(b( )As Integer,n As Integer)
Dim c(10)AsInteger
j=0
For i=1 To n
b(i)=CInt(Rnd( )*100)
If b(i)/2=b(i)/2 Then
j=j+1
c(j)=b(i)
End lf
Next
Print j
End Sub
以下叙述中错误的是
A. 数组b中的偶数被保存在数组c中
B. 程序运行结束时,在窗体上显示的是c数组中元素的个数
C. GetArray过程的参数n是按值传送的
D. 如果输入的数据大于10,则窗体上不显示任何信息
[填空题]设有如下程序:
Option Base 1
Pfivme Sub Command1_Click( )
Dim arr1
Dim Min As Integer,i As Integer
arrl=Array(12,435,76,-24,78,54,866,43)
Min= 【12】
For i=2 TO 8
If arr1(i)<Min Then 【13】
Next i
Print“最小值是:”;Min
End Sub
以上程序的功能是:用Array函数建立一个含有8个元素的数组,然后查找并输出该数组中各元素的小值。请填空。
[填空题]阅读下列程序。
Option Base 1
Private Sub Form Click( )
Dim x(3,3)
For j=l to 3
For k=l to 3
If j=k then x(j,k)=l
If j<>k then x(j,k)=k
Next k
Next j
Call fun(x( ))
End Sub
Private Sub fun(x( ) )
For j=1 to 3
For k=1 to 3
Print x(j,k);
Next k
Next j
End Sub
运行程序时,输出结果为 【14】
[单项选择]设有如下程序:
Option Base 1
Private Sub Command1_Click( )
Dim a(10) As Integer
Dim n As Integer
n=InputBox(“输入数据”)
If n<10 Then
Call GetArray(a,n)
End If
End Sub
Private Sub GetArray(b( )As Integer,n As Integer)
Dim c(10) As Integer
j=0
For i=1 To n
bb(i)=CInt(Rnd( )*100)
If b(i)/2=b(i)/2 Then
j=j+1
c(j)=b(i)
End If
Next
Print j
End Sub
以下叙述中错误的是( )。
A. 数组b的偶数被保存在数组c中
B. 程序运行结束时,在窗体上显示的是c数组中元素的个数
C. GetArray过程的参数n是按值传送的
D. 如果输入的数据大于10,则窗体上不显示任何信息
[填空题]阅读下列程序。
Option Base 1
Private Sub Form Click( )
Dim x(3,3)
For j=l to 3
For k=l to 3
If j=k then x(j,k)=l
If j<>k then x(j,k)=k
Next k
Next j
Call fun(x( ))
End Sub
Private Sub fun(x( ) )
For j=1 to 3
For k=1 to 3
Print x(j,k);
Next k
Next j
End Sub
运行程序时,输出结果为 【14】
[填空题]设有如下程序:
Option Base 1
Pfivme Sub Command1_Click( )
Dim arr1
Dim Min As Integer,i As Integer
arrl=Array(12,435,76,-24,78,54,866,43)
Min= 【12】
For i=2 TO 8
If arr1(i)<Min Then 【13】
Next i
Print“最小值是:”;Min
End Sub
以上程序的功能是:用Array函数建立一个含有8个元素的数组,然后查找并输出该数组中各元素的小值。请填空。
[填空题]阅读下列程序:
Option Base 1
Private Sub Form Click( )
Dim x(3, 3)
For j = 1 to 3
For k = 1 to 3
If j = k then x(j, k) = 1
If j < > k then x(j, k) =3
Next k
Next j
Call fun(x( ) )
End Sub
Private Sub fun(a( ) )
For j = 1 to 3
For k = 1 to 3
Print a(j, k);
Next k
Next j
End Sub
运行程序时,输出的结果是 【5】 。
[填空题]设有程序:
Option Base 1
Private Sub Command1 Click( )
Dim arrl,Max as Integer
arrl=Array(12,435,76,24,78,54,866,43)
______ =arrl(1)
For i=1 To 8
If arrl(i)>Max Then_______
Next i
Print“最大值是:”;Max
End Sub
以上程序的功能是:用Atray函数建立一个含有8个元素的数组,然后查找并输出该数组中元素的最大值。请填空。
[填空题]有如下程序:
Option Base 1
Private Sub Form_Click( )
Dim arr,sum
Sum=0
arr=Array(1,3,5,7,9,11,13,15,17,19)
For i=1 To 10
If arr(i) /3=arr(i) /3 Then
Sum=Sum+arr(i)
End If
Next i
MsgBox Sum
End Sub
程序运行后,单击窗体,消息框的输出结果为______。