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

题目内容 (请给出正确答案)

'下面的程序运行时,单击窗体后,窗体上显示的结果是(B )。

Private Sub Form_Click(B )

Dim a(1 To 5)As Integer

a(1)= 2: a(2)= 3: a(3)= 1: a(4)= 5: a(5)= 4

n = 5

For i = 1 To n - 1

Min = i

For j = i + 1 To n

If a(j)< a(Min)Then Min = j

Next j

t = a(i): a(i)= a(Min): a(Min)= t

Next i

For i = 1 To n

Print a(i);

Next i

End Sub

A. 2 3 1 5 4

B. 1 2 3 4 5

C. 9 8 7 6 5

D. 5 5 5 5 5


参考答案

更多 “ '下面的程序运行时,单击窗体后,窗体上显示的结果是(B )。Private Sub Form_Click(B )Dim a(1 To 5)As Integera(1)= 2: a(2)= 3: a(3)= 1: a(4)= 5: a(5)= 4n = 5For i = 1 To n - 1Min = iFor j = i + 1 To nIf a(j)Next jt = a(i): a(i)= a(Min): a(Min)= tNext iFor i = 1 To nPrint a(i);Next iEnd SubA. 2 3 1 5 4B. 1 2 3 4 5C. 9 8 7 6 5D. 5 5 5 5 5 ” 相关考题
考题 设有如下程序: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

考题 阅读下面的程序:Private Sub Form_Click()Dim Check As Boolean, Counter As IntegerCheck = TrueCounter = 5DoDo While Counter 20Counter = Counter + 1If Counter = 10 ThenCheck = FalseExit DoEnd IfLoopLoop Until Check = FalsePrint CounterEnd Sub程序运行后,单击窗体,输出结果为______。

考题 设有如下程序:Private Sub Form_Click()Dim n As Integer, s As Integern = 8s = 0Dos = s + nn = n - 1Loop While n 0Print sEnd Sub以上程序的功能是______。程序运行后,单击窗体,输出结果为______。

考题 下列程序,当单击窗体时s的值是( )Private Sub Form_Click()Dim s As Integers = Not 2 * 5<>11Print sEnd SubA. TrueB. FalseC.1D.0

考题 设有如下程序:Private Sub Form_Click()Dim i As Integer,x As String,Y As Stringx=”ABCDEFG”For i=4 To 1 Step-1y=Mid(x,i,i)+yNext iPrint yEnd Sub程序运行后,单击窗体,输出结果为A.ABCCDEDEFGB.AABBCDEFGC.ABCDEFGD.AABBCCDDEEFFGG

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

考题 有如下程序:Option Base 1Private Sub Form_Click()Dim arr,SumSum=0For i=1 To 10If arr(i)/3=arr(i)\3 ThenEnd IfNext iEnd Sub程序运行后,单击窗体,消息框的输出结果为( )。

考题 阅读以下程序:Private Sub Form_click()Dim k, n, m As integern = 20m = 1k = 1Do While k <= nm=m+2k = k + 1LoopPrint mEnd Sub单击窗体程序的执行结果是【 】。

考题 设有如下程序: 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 Command1_Click() Dim a As Integer, b As integer b = 1 For a = 1 To 100 If b >= 10 Then Exit For If b Mod 3 = 1 Then b = b + 3 End If Next a Print a End Sub 在命令按钮上单击后,窗体上显示的结果是 ______。A.101B.6C.5D.4

考题 以下程序运行时连续单击4次窗体,则第4次单击窗体后消息框中的输出结果为【 】。PRIVATE FORM_CLICK( )STATIC A AS INTEGERDIM B AS INTEGERB=A+B+1A=A+BMSGBOX A"," BEND 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 Form_Click( )Dim k As Integer ,n As Integer ,m As Integern=10:m=1:k=1Do While k<=nm=m*2k=k+1LoopMsgBox mEnd Sub

考题 以下程序运行时,单击窗体后,在窗体上输出的结果是 ______。 Private SubForm_Click() Dim a As Integer,b As Integer a=10 :b=20 Call ff(a,B)Print a,b End Sub Private Sub ff(x As Integer,y As Integer) x=x+y y=x+y End SubA.30 50B.30 30C.20 20D.10 20

考题 在窗体上绘制一个文本框,然后编写如下事件过程: Private Sub Form_Click() x=InputBox("请输入一个整数") Print x+Text1.Text End Sub 程序运行时,在文本框中输入456,然后单击窗体,在输入对话框中输入123,单击“确定”按钮后,在窗体上显示的内容为( )。A.123B.456C.579D.123456

考题 下面程序运行时,单击窗体后,窗体上显示的结果是( )。 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( )x = 8: y = 2Call fun1((x), y)Print x, yEnd SubPrivate Sub fun1(x, y)s = xx = s / yy = s Mod yEnd Sub单击窗体后,则在窗体上显示的结果是( )。A.4 2B.8 2C.8 0D.2 4

考题 运行下列程序: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

考题 运行下列程序:Dim bPrivate Sub Form_Click( )a = 1: b = 1Call fun1(a)Print "X = X = ; a; ,Y = ; bEnd SubPrivate Sub fun1(a)b = 2 * aa = 3 * bEnd Sub单击窗体后,则在窗体上显示的结果是( )。A.X = 1,Y = 1B.X = 2,Y = 6C.X = 6,Y = 2D.X = 6,Y = 1

考题 '下面的程序运行时,单击窗体后,窗体上显示的结果是( )。Private Sub Form_Click(B )Dim a(1 To 5)As Integera(1)= 2: a(2)= 3: a(3)= 1: a(4)= 5: a(5)= 4n = 5For i = 1 To n - 1Min = iFor j = i + 1 To nIf a(j)Next jt = a(i): a(i)= a(Min): a(Min)= tNext iFor i = 1 To nPrint a(i);Next iEnd SubA. 2 3 1 5 4B. 1 2 3 4 5C. 9 8 7 6 5D. 5 5 5 5 5

考题 设有如下程序: 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

考题 执行下面的程序,单击窗体后窗体消息框内显示结果是( )。 PRIVATE SUB FORM_CLICK() DIM STR AS STRING, K AS INTEGER STR="AB" FOR K = LEN(STR) TO 1 STEP -1 STR=STRCHR(ASC(MID(STR, K, 1)) +K) NEXT K MSGBOX STR END SUBA.ABCEB.ABCDC.ABDBD.ABFB

考题 设有如下程序: 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