更多"执行下列程序,输入框中显示的默认字符串为 【7】 。 Pr"的相关试题:
[填空题]执行下列程序,输入框中显示的默认字符串为 【7】 。
Private Sub Command1_Click( )
InputBox "Ok" , "输入参数", Format(" &H12" )
End Sub
[填空题]执行下列程序,输入框中显示的默认字符串为 【11】 ;
Pirate Sub Command 1_Click( )
InputBox"ok","输入参数",Format("&H12")
End Sub
[填空题]执行下列程序,输入框中显示的默认字符串为 【6】 :
Private Sub Command1_Click( )
InputBox "ok","输入参数",Format("&H12")
End Sub
[填空题]执行下列程序,输入框中显示的默认字符串为上【6】:
Private Sub Command l_Click ( )
Input Box”ok”“输入参数”,Format(”GHl2”’
End Sub
[填空题]执行下列程序,输入框中显示的默认字符串为上【6】:
Private Sub Command l_Click ( )
Input Box”ok”“输入参数”,Format(”GHl2”’
End Sub
[单项选择]单击一次命令按钮之后,下列程序代码的执行结果为______ 。 Private Sub Command1_ Click( ) a = fun(4) + fun(5) Print a; End Sub Public Function fun (n As Integer) Static Num For i = 1 To n Num = Num + i Next i fun = Num End Function
A. 15
B. 20
C. 35
D. 40
[简答题]【说明】
单击窗体上的“测试”(cmdTest)按钮,出现一个输入框,要求输入一串字符,将该字符串中的非字母字符删除后,显示在窗体中的一个文本框(txtShow)中。
【程序代码】
Private Sub cmdTest_Click( )
Dim strT1 ,strT2 As String
Dim strCh As (1)
Dim intL As Integer
Dim intl As Integer
strT1 = (2) ("请输入一串字符","字符串输入")
intL = (3)
strT2 = " "
For intl = I To intL
strCh = Mid ( strT1, intl, 1 )
If(strCh>"A"And (4) ) Or (strCh >"a" And suCh <"z" )Then
strT2 = strT2 + strCh
End If
Next intl
txtShow. Text= (5)
End sub
[单项选择]在窗体上画一个名称为Command1的命令按钮,编写如下程序: Private Sub Command1_Click( ) Print p1(3,7) End Sub Public Function p1(x As Single,n As Integer) As Single If n=0 Then p1=1 Else If n Mod 2=1 Then p1=x*x+n Else p1=x*x-n End If End If End Function 程序运行后,单击该命令按钮,屏幕上显示的结果是( )。
A. 2
B. 1
C. 0
D. 16
[单项选择]当发生Command1_C1ick事件后,以下程序的输出结果是
Private Sub Command1_Click( )
Dim i As Integer
Dim a(10) As Integer
For i=9 To 0 Step -1
a(i)=10-i
Next i
Print a(2);a(5);a(8)
End Sub
A. 2 5 8
B. 7 4 1
C. 8 5 2
D. 3 6 9
[单项选择]在窗体上画一个名称为Command1的命令按钮,然后编写如下程序:
Private Sub Command1_ Click( )
Static x As Integer
Static y As Integer
Cls
y=1
y=y+5
x=y +x
Print x, y
End Sub
程序运行时,三次单击命令按钮Command1后,窗体上显示的结果为______。
A. 15 16
B. 15 6
C. 15 15
D. 5 6
[单项选择]在窗体上画一个命令按钮,名称为Command1,然后编写如下程序:
Private Sub Command1_ Click( )
Dim a As Integer, b As Integer
do while b <100
b=b+5
a=a+ b
if b >20 then exit do
Loop
Print a, b
End Sub
程序运行后,如果甲击命令按钮,则在窗体上显示的内容是______。
A. 50 20
B. 75 25
C. 50 25
D. 75 20
[单项选择]
在窗体上画一个名为Command1的命令按钮,然后编写以下程序:
Private Sub Command1_Click( )
Dim M(10)As Integer
For k=1 To 10
M(k)=12-k
Next k
x=8
Print M(2+M(x))
End Sub
运行程序,单击命令按钮,在窗体上显示的是()。
A. 6
B. 5
C. 7
D. 8
[填空题]下面运行程序后,单击命令按钮,输出出的结果是 【12】 。
Private Sub Command1_Click( )
Dim a% (1 To 5) ,i%, s#
For i = 1 To 5
a(i) =i
Next
s = Fun(a)
Print"s="; s;
End Sub
Function Fun(a( ) As Integer)
Dim t#, i%
t=1
For i = LBound(a) To UBound(a)
t=t * a(i)
Next
Fun =t
End Function
[填空题]
在窗体上画—个名为Command1的命令按钮,然后编写如下程序:
Private Sub Command1_Click( )
Dim i As Integer
Sum=0
n=InputBox("Enter a number")
n=Val(n)
For i=1 To n
Sum= 【12】
Next i
Print Sum
End Sub
Function fun(t As Integer)As Long
p=1
For i=1 To t
p=p*i
Next i
【13】
End Function
以上程序的功能是,计算1!+2!+3!+...+n!,其中n从键盘输入,请填空。
[填空题]以下程序段的作用是计算数据的和,数据的个数是可变的。请填空。
Private Sub Command1_Click( )
Dim a As Integer
a=0
Sum a, 1, 5, 2
Print "sum of 3 = "; a
a = 0
Call Sum(a, 1, 3, 5, 7, 9)
Print "sum of 5 = "; a
End Sub
Private Sub Sum(x As integer, 【3】
Dim y As Variant
For 【4】
x = x + y
Next y
End Sub