网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
程序运行后,单击窗体,则在窗体上显示的内容是(). Private Sub Form_Click( ) Dim a(1 To 6)As Integer Dim min1%,i%,j%,n%,t%,k% a(1)=8:a(2)=6:a(3)=9:a(4)=3:a(5)=2:a(6)=7 n=6 For i=1 To n-1 min 1=i For j=i+1 To n If a(j)<a(min1)Then min1=j Next j t=a(i):a(i)=a(min1):a(min1)=t Next i For i=1 To n Print a(i) Next i End Sub
A

9 8 7 6 3 2

B

2 3 6 7 8 9

C

9 8 7 6 3

D

2 3 6 7 8


参考答案

参考解析
解析: 本题考查循环程序的分析。程序主要包括两条循环语句,一条为两层循环的嵌套语句,内层循环找到当前i到n之间的最小元素的下标,退出内循环则把最小元素放到a(i)的位置,i从1变化到n-1;另外一条循环语句为输出数组中的所有元素,即把排序以后的结果输出。
更多 “单选题程序运行后,单击窗体,则在窗体上显示的内容是(). Private Sub Form_Click( ) Dim a(1 To 6)As Integer Dim min1%,i%,j%,n%,t%,k% a(1)=8:a(2)=6:a(3)=9:a(4)=3:a(5)=2:a(6)=7 n=6 For i=1 To n-1 min 1=i For j=i+1 To n If a(j)<a(min1)Then min1=j Next j t=a(i):a(i)=a(min1):a(min1)=t Next i For i=1 To n Print a(i) Next i End SubA 9 8 7 6 3 2B 2 3 6 7 8 9C 9 8 7 6 3D 2 3 6 7 8” 相关考题
考题 设有如下程序:Option Base 0Private Sub Form_Click()Dim aDim I As Integera=Array(1,2,3,4,5,6,7,8,9)For I=0 To 3Print a(5 – I);Next IEnd Sub程序运行后,单击窗体,则在窗体上显示的是( )。 A.4321B.5432C.6543D.7654

考题 在窗体中添加一个命令按钮,名称为Command1,然后编写如下程序: Private Sub Command1_Click() Dim a As Integer, b As String, c As Integer a=1234: b=Str(a)c=Len(b)Print c End Sub 程序运行后,单击命令按钮,则在窗体上显示的内容是______。A.0B.5C.6D.7

考题 在窗体上画一个文本框和一个图片框,然后编写如下两个事件过程:Private Sub Form_Click()Text1.Text = "VB程序设计"End SubPrivate Sub Text1_Change()Picture1.Print "VB Programming"End Sub程序运行后,单击窗体,则在文本框中显示的内容是______,而在图片框中显示的内容是_____。

考题 在窗体上画一个命令按钮,名称为Commandl,然后编写如下事件过程: Private Sub Commandl_Click() Dim a() a=Array(“机床”,”车床”,”钻床”,”轴承”) Print a(2) End Sub 程序运行后,如果单击命令按钮,则在窗体上显示的内容是( )。A.机床B.车床C.钻床D.轴承

考题 设有如下程序:Private Sub Form_Click()Dim ary(1 To 5)As IntegerDim i As IntegerDim sum As IntegerFor i=1 To 5ary(j)=i+1sum=sum+ary(i)Next 1Print sumEud Sub程序运行后,单击窗体,则在窗体上显示的是A.15B.16C.20D.25

考题 设有以下窗体单击事件过程:Private Sub Form_Click()a=1For i=1 To 3End SelectNext iEnd Sub打开窗体运行后,单击窗体,则消息框的输出内容是( )。

考题 (10)在窗体上画一个文本框和一个图片框,然后编写下列两个事件过程: Private Sub Form_Click() Text1.Text="VB Programming" End Sub Private Sub Text1_Change() Picture1.Print"VB程序设计" End Sub 程序运行后,单击窗体,则在文本框中显示的内容是,而在图片框中显示的内容是 。

考题 设有如下程序:Private Sub Form. Click( )Dim ary(1 To 5)As IntegerDim i As IntegerDim sum As IntegerFor i=1 To 5ary(i)=i+lsum=sum+ary(i)Next iPrint sumEnd Sub程序运行后,单击窗体,则在窗体上显示的是( )。A.15B.16C.20D.25

考题 设有如下程序: Private Static Function Fac(n As Integer)As Integer Dim f As Integer f=f+n Fac=f End Function Private Sub Form_Click( ) Dim I As Integer For 1=2 To 3 Print"#";I“=”Fac(1) Next I End Sub 程序运行后,单击窗体,在窗体上显示的是A.#2=2 #3=3B.#2=2 #3=5C.#;2=2 #;3=3D.#;2=2 #3;=5

考题 在窗体上绘制一个文本框和一个图片框,然后编写如下两个事件过程:Private Sub Form_Click()Text1.Text="VB程序设计"End SubPrivate Sub Text1_Change()Picmml.Print"VBProgramming"End Sub程序运行后,单击窗体,则在文本框中显示的内容 [9] ,而在图片框中显示的内容是 [10] 。

考题 有下列程序: Option Base 0 Private Sub Command1_Click() Dim City As Variant x = Array("Visual","Basic","Microsoft","Programming") Print x(2) End Sub 程序运行后,单击命令按钮,则在窗体上显示的内容是A.MicrosonB.错误提示C.VisualD.Basic

考题 设有如下程序: Private Sub Form_Click() A=1 For i=1 To 3 Select Case i Case 1,3 A=A+1 Case 2,4 A=A+2 End Select Next i Print A End Sub 程序运行后,单击窗体,则在窗体上显示的内容是A.6B.5C.4D.3

考题 设有如下程序: 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 程序运行后,单击窗体,则在窗体上显示的是( )。A.4 3 2 1B.5 4 3 2C.6 5 4 3D.7 6 5 4

考题 在窗体上画一个命令按钮,名称为Command1,然后编写如下事件过程:Private Sub Command1_Click()Dim a()a=Array("机床","车床","钻床","轴承")Print a(2)End Sub程序运行后,如果单击命令按钮,则在窗体上显示的内容是( )。A.机床B.车床C.钻床D.轴承

考题 编写如下事件过程: Option Explicit Private Sub Form_Click() Dim Str As String, I As Integer Open "examp" For Output As 1 For I=1 To 5 Str=Chr(I+64) Print #1,Str; Next I Close 1 Open”examp',For lnput AS 2 Str=Input(10,#2) Print Str; Close 2 End Sub 程序运行后,单击窗体,则窗体上显示的内容是A.ABCDEB.96C.65D.abcde

考题 下面程序运行时,单击窗体后,窗体上显示的结果是( )。 Private Sub Form_Click Dim I As Integer Dim sum As Long Dim t1 As Long t1=1:sum=0 For 1=1 To 3 t1=t1*I sum=sum+t1 Next I Print sum End SubA.3B.9C.5D.6

考题 设有如下程序: Private Sub Form. Click( ) Dim ary(1 To 5)As Integer Dim i As Integer Dim sum As Integer For i=1 To 5 ary(i)=i+l sum=sum+ary(i) Next i Print sum End Sub 程序运行后,单击窗体,则在窗体上显示的是( )。A.15B.16C.20D.25

考题 运行下列程序:Private Sub Form_Click( )Dim x As Integer, y As String, z As Stringy = 12345For x = 1 To Len(y)z = Mid(Left(y, x), 1)Next xPrint zEnd Sub单击窗体后,则在窗体上显示的结果是( )。A.1B.11111C.55555D.12345

考题 运行下列程序:Private Sub Form_Click( )a$ = 2b$ = 1Call abcd(a, b, c$, d$)Print c; dEnd SubPrivate Sub abcd(x$, y$, z$, s$)z = x + ys = x - yEnd Sub单击窗体后,则在窗体上显示的结果是( )。A.3 1B.1 3C.211D.显示出错信息

考题 运行下列程序:Private Sub Form_Click( )Dim y As Integer, x As IntegerDo Until x > 20x 运行下列程序:Private Sub Form_Click( )Dim y As Integer, x As IntegerDo Until x 20x = x + 10y = y + xIf x 20 Then Exit DoLoopPrint x, yEnd Sub单击窗体后,则在窗体上显示的结果是( )。A.10 20B.30 60C.10 30D.20 60

考题 运行下列程序:Private Sub Form_Click( )Dim a As Integera = 1For i = 1 To 5Call fun1(a)Next iPrint aEnd SubPrivate Sub fun1(x)y = 2Dox = x + yLoop Until x 10End Sub单击窗体后,则在窗体上显示的结果是( )。A.5B.1 2 3 4 5C.19D.7

考题 设有如下程序: Option Base 0 Private Sub Form_Click() Dim a Dimi 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 程序运行后,单击窗体,则在窗体上显示的是______。A.4 3 2 1B.5 4 3 2C.6 5 4 3D.7 6 5 4

考题 在窗体中添加一个命令按钮,名称为Commandl,然后编写如下程序: Private Sub Command1_Click() Dim a As Integer,b As String,C As Integer a = 1234 : b = Str(A)c = Len(B)Print c End Sub 程序运行后,单击命令按钮,则在窗体上显示的内容是A.0B.5C.6D.7

考题 设有如下程序: 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 程序运行后,单击窗体,则在窗体上显示的是A.4 3 2 1B.54 3 2C.6 5 4 3D.7 6 5 4

考题 在窗体上画一个文本框和一个图片框,然后编写口下两个事件过程:Private Sub Form_Click()Text1.Text="VB程序设计"End SubPrivate Sub Text1_Change()PicturePrint"VB programming"End Sub程序运行后,单击窗体,则在本框中显示的内容是【 】,而在图片框中显示的内容是【 】。

考题 设有如下程序: 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 程序运行后,单击窗体,则在窗体上显示的是()A、4;3;2;1B、5;4;3;2C、6;5;4;3D、7;6;5;4

考题 设有如下程序: Private Sub Command1_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 I End Sub 程序运行后,单击窗体,则在窗体上显示的是()A、4321B、5432C、6543D、7654

考题 单选题设有如下程序: 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 程序运行后,单击窗体,则在窗体上显示的是()A 4;3;2;1B 5;4;3;2C 6;5;4;3D 7;6;5;4