题目内容

下列程序运行时输出的结果是()。 Option Base 1 Const a=10 Private Sub Form_Click() Dim x(A)As Integer k=-1 For i=1 To a x(i)=i*k k=(-1)*k Next i For i=1 To 10 Print x(i) Next i End Sub

A. 1 3 5 7 9 10
B. -1-3-5-7-9
C. -1 2-3 4-5 6-7 8-9 10
D. 1-2 3-4 5-6 7-8 9-10

查看答案
更多问题

在窗体上画一个名称为Text1的文本框,然后画3个单选按钮,并用这3个单选按钮建立一个控件数组,名称为Option1,程序运行后,如果单击某个单选按钮,则文本框中的字体将根据所选择的单选按钮切换,请选择空白处合适的语句()。 Private Sub Optionl_Click(Index As Integer) Select Case Case 0 a="宋体" Case 1 a="黑体" Case 2 a="楷体 GB2312" End Select Text =a End Sub

A. Option Text
B. Index Text
C. Index Font
D. Option Font

有如下函数过程: Function funl(ByVal x As Integer,ByVal y As Integer)As Integer Do While y<>0 reminder=x Mod y x=y y=reminder Loop fun1=x End Function 在下列按钮单击事件中调用该函数,则该程序的运行结果是()。 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a=100 b=25 x=funl(a,B)Print x End Sub

A. 0
B. 25
C. 50
D. 100

下列()事件过程可以将打开文件对话框的标题改变为“new Caption”。

A. Prirate Sub Commandl Click() CommonDialogl.DialogTitle="new Caption" CommonDialogl.ShowFont End Sub
B. Private Sub Commandl+Click() CommonDialogl.DialogTitle="new Caption" CommonDialogl.ShowOpen End Sub
C. Private Sub Commandl_Click() CommonDialogl.DialogTitle="new Caption" CommonDialogl.ShowHelp End Sub
D. Private Sub Commandl_Click() CommonDialogl.DialogTitle="new Caption" CommonDialogl.ShowColor End Sub

下列程序代码实现生成20个0~100之间的随机整数,存于数组中,打印数组中大于50的数,并求这些数的和。请选择正确的程序段是(),完成程序。 Private Sub Commandl_Click() Dim arr(1 To 20) For i=1 To 20 arr(i)=______ Textl.Text=Textl.Text & arr(i)& Chr(13)& Chr(10) Next i Sum=0 For Each X ______ If X>50 Then Print Tab(20);X Sum=Sum+X End If Next X Print Tab(20);"Sum=";Sum End Sub

A. Int(Rnd*99+1) In arr
B. Int(RnD)In arr
C. Int(Rnd*99+1) In arr()
D. Int(RnD)In arr()

答案查题题库