题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-11-16 22:39:38

[填空题]

执行下面的程序,单击command1,窗体上显示的第一行是(),第二行是(),第四行是(),最后一行是()

Option Explicit

Private Sub Command1_Click( )

Dim n As Integer

n=5

Call test(n)

Print n

End Sub

Private Sub test(ByVal n As Integer)

Dim i As Integer,S As String

If n>0 Then

For i=l To n

S=S & CStr(i)

Next i

Print S

Call test(n-2)

Else

Print "0VER"

EndIf

EndSub


更多"执行下面的程序,单击command1,窗体上显示的第一行是(),第二行"的相关试题:

[填空题]

执行下面程序,单击命令按钮Command1,窗体上显示的第一行内容是(),第二行内容是(),第三行内容是().

Option Explicit
Private Sub Command1_Click( )
Dim a As Integer, b As Integer, i As Integer
a = 1
b = 5
For i = b To a Step -1
a = a + i
b = b + a
If b > 30 Then Exit For
Print a, b
Next i
Print a, b
End Sub


[填空题]运行下列程序,单击Command1,在窗体上显示的第一行内容是(),第二行的内容是(),第三行的内容是()("A"的ASCII码是65,"z"是90) Option Explicit Private Sub Commandl_Click( ) Dim i As Integer,st As String,n As Integer,p As String*1 P="B" For i=3 To 1 Step -1 n=Asc(p)-i If n<65 Then n=n+26 st=Chr(n) st=st & F(i) Print st Next i EndSub Private Function F(n As Integer) Dim i As Integer Static S As Integer For i=1 To n s=s+i Nexti F=S End Function
[填空题]运行下列程序,单击Command1命令按钮后,则在窗体上显示第一行和第二行的结果分别是 (14) (15)
Private Sub Command1_Click( )
  t = 1: x = 2: y = 3: z = 4
  If t > 0 Or t = x And x <> y Or y > z Then
    t = fun1(t, z)
    Print t
  Else
    t = fun1(x, y)
    Print t
  End If
    Print x
    Print y
End Sub
Function fun1(ByVal x As Integer, ByVal y As Integer)As Integer
  Do While y <> 0
    t = x / y
    x = y
    y = t
  Loop
  fun1 = x
End Function

[填空题]

执行下面程序,单击Commandl,则图片框中显示的第一行是(),显示的第二行是() ,最后一行显示的是 () 。

Private Sub Command1_Click( )

Dim a(3,3)As Integer

Dim i As Integer,j As Integer

For i=1 To 3

For j=3 To 1 Step -1

If i>=j Then

a(i,j)=i-j

Else

a(i,j)=j-i

End If

Next j

Next i

For i=1 to 3

For j=3 To 1 Step -1

Picture1.Print a(i,j);

Next j

Picturel.Print

Next i

EndSub


[单项选择]下面程序执行时,在窗体上显示的是
Private Sub Command1_Click( )
Dim a(10)
For k=1 To 10
a(k)=11-k
Next k
Print a(a(3)/a(7) Mod a(5))
End Sub
A. 3 B) 5 C) 7 D) 9
[单项选择]下面程序执行时,在窗体上显示的是( )
Private Sub Command1_Click( )
Dim a(10)
For k=1 To 10
a(k)=11 - k
Next k
Print a(a(3)/a(7)Mod a(5))
End Sub
A. 3
B. 5
C. 7
D. 9
[单项选择]程序代码如下,当单击窗体上的Command1控件时,窗体上显示的结果是( )。
Private Sub Command1_Click( )
Dim i As Integer,k As Integer
Dim a(9) As Integer,p(2)As Integer
k=5
For i=0 To 9
a(i)=i
Next i
For i=0 To 2
p(i)=a(i*(i+1))
Next i
For i=0 To 2
k=k+p(i)*2
Next i
Print k
End Sub
A. 20
B. 21
C. 22
D. 23
[单项选择]程序代码如下,当单击窗体上的Command1控件时,窗体上显示的结果是( )。
Option Base 1
Private Sub Command1_Click( )
Dim i As Integer
Dim x(3,3)As Integer
For i=1 To 3
For j=1 To 3
x(i,j)=(i-1)*3+j
Next j
Next i
For i=1 To 3
Print x(i,4-i);
Next i
End Sub
A. 1 5 9
B. 1 4 7
C. 3 5 7
D. 3 6 9
[填空题]

执行下面程序,单击命令按钮CmdRun后,文本框Text1中第一行显示的内容是() , 第二行显示的内容是()。第三行显示的内容是()。
Option Explicit
Private Sub CmdRun_Click( )
Dim S As String,Subs As String,P As Integer
S="100101 010110 110101"
Do
P=InStr(S," ")
If P<>0 Then
Subs=Left(S,P-1)
Else
Subs=S
End If
S=Mid(S,P+1)
Text1=Text1 & Complement(Subs) & vbCrLf
Loop Until Len(S)=0 Or P=0
End Sub
Private Function Complement(S As String)As Integer
Dim P As Integer,L As Integer
L=Len(S)
If Left(S,1)=1 Then
Complement=-32
End If
P=1
Do Until P=0
P=InStr(P+1,S,"1")
If P<>0 Then
Complement=Complement+2^(L-P)
End If
Loop
End Function


[填空题]

执行下面程序,单击命令按钮CmdRun后,图片框Pic1第一行显示内容是(),第二行显示内容是(),最后一行显示内容是()。
Option Explicit
Private Sub CmdRun_Click( )
Dim N As Integer,M As Integer
M=135
N=8
Pic1.Print Fun(M,N)
EndSub
Private Function Fun(ByVal N As Integer,ByVal R As Integer)As String
Dim L As Integer
If N
Fun=N
Else
L=N/R
Fun=Fun(L,R)
Fun=Fun & N Mod R
End If
Pic1.Print N
End Function


[填空题]

执行下面程序,单击命令按钮Cmd1后,窗体上显示的第一行内容是(),第二行内容是(),第三行内容是()。
Option Explicit
Private Sub Cmd1_Click( )
Dim st As String,ch As String*1,t As Integer
Dim i As Integer
st="2,3,8,12,32,65#"
For i=1 To Len(st)
ch=Mid(st,i,1)
If ch<>"," And ch<>"#" Then
t=t*10+Val(ch)
Else
If pd(t) Then Print t
t=0
End If
Next i
End Sub
Private Function pd(ByVal n As Integer)As Boolean
Do While n<>1
If n Mod 2<>0 Then
Exit Function
EndIf
n=n/2
Loop
pd=True
End Function


[单项选择]程序代码如下,当单击窗体上的Command1控件时,在窗体上输出的结果是( )。 Private Sub Command1_Click( ) Dim aa(3,3)As Integer Dim i As Integer,j As Integer Dim s As Integer For i=0 To 3 For j=0 To 3 aa(i,j)=i*4+j+1 Next j Next i For i=0 To 3 s=s+aa(i,1) Next i Print s End Sub
A. 32
B. 28
C. 30
D. 36
[填空题]

执行下面程序,单击按钮CmdRun,窗体上显示的第一行结果是(),UBound(a)的值为(),其中a(1)的值为().
Option Explicit
Private Sub CmdRun_Click( )
Dim St As String,i As Integer
Dim a( ) As String,j As Integer,k As Integer
St="abcd"
Call Sub1(St)
Print St
For i=1 To Len(St)
For j=i+1 To Len(St)
If Mid(St,i,1)=Mid(St,j,1) Then Exit For
Next j
If j>Len(St) Then
k=k+1
ReDim Preserve a(k)
a(k)=Mid(St,i,1)
Print "a(";k;")=";a(k)
End If
Next i
End Sub
Private Sub Sub1(S As String)
Dim i As Integer
For i=1 To Len(S)/2
Mid(S,i,1)=Mid(S,Len(S)-i+1,1)
Next i
End Sub


[单项选择]在窗体上放置一个命令按钮Command1,并编写下列单击事件的程序:
Option Base 1
Private Sub Command1_ Click( )
Dim c As Integer,d As Integer
d=0
c=6
X=Array(2,4,6,8,10,12)
For i=1 To 6
If X(i)>c Then
d=d+X(i)
c=X(i)
Else
d=d.C
End If
Next i
Print d
End Sub
程序运行后,单击命令按钮,则在窗体上输出的结果是( )
A. 10
B. 12
C. 16
D. 20

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

截图扫码使用小程序[完全免费查看答案]
请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码