更多"以下程序运行后,单击命令按钮,窗体显示的结果是 ______。 Pr"的相关试题:
[单项选择]有下列程序,程序运行后单击命令按钮,则输出的结果是( )。
Private Sub Command1_Click( )
Dim a%(1 To 4),b%(3 To 6),i%,s1#,s2#
For i=1 To 4
a(i)=i
Next i
For i=3 To 6
b(i)=i
Next i
s1=Factorial(
A.
B.
[单项选择]下面程序运行后,单击命令按钮,输出的结果是 Pivate Sub Cornmand1_Click( ) Dim a%(1 To 4),b%(2 To 6),i%,str1#,str2# For i=1 To 4 a(i)=i Next For i=2 To 6 b(i)=i Next str1=YAG(a) str2=YAG(b) Print"str1=";str1;"str2=";str2 End Sub Function YAG(a( )As Integer) Dim t#,i% t=1 For i=LBound(a)To UBound(a) t=t*a(i) Next YAG=t End Function
A. str1=24 str2=720
B. str1=12 str2=360
C. str1=24 str2=180
D. str1=36 str2=720
[填空题]下面程序运行后,单击命令按钮,输出的结果是______。
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
[填空题]下面程序运行后,单击命令按钮,输出的结果是______。
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
[单项选择]若有以下程序,当程序运行后,单击命令按钮,则输出的结果为( )。 Private Sub Command1_Click( ) Dim a%(1 To 4), b%(3 To 6), i%, s1#, s2# For i= 1 To 4 a(i) = i Next i For i=3 To 6 b(i) = i Next i s1 = Factorial (A) s2 = Factorial (B) Print "s1="; s1; "s2="; s2 End Sub Function Factorial(a( ) As Integer) Dim t#, i% t=1 For i = LBound(A) To UBound(A) t = t * a(i) Next i Factorial = t End Function
A. s1=360 s2=24
B. s1=24 s2=360
C. s1=24 s2=24
D. s1=360 s2=360
[填空题]以下程序的功能是在程序运行后,单击命令按钮,输出如下结果:
1 4 7
2 5 8
3 6 9
请完善以下程序。
Private Sub Command1_Click( )
Dim Arr(3,3)As Integer
For i=1 To 3
For j=1 To 3
Arr(i,j)= 【15】
Print Arr(i,j);
Next j
Print
NeXt i
End Sub
[填空题]以下程序的功能是:程序运行后,单击命令按钮,输出结果为:
1 4 7
2 5 8
3 6 9
请填空。
Private Sub Command1_Click( )
Dim Arr(3,3)As Integer
For i=1 To 3
For j=1 To 3
Arr(i,j)=______
Print Arr(i,j);
Next j
Print
Next i
End Sub
[单项选择]单击命令按钮时,下列程序代码的执行结果为( )。
Private Function PickMid(xStr As String)As Sting
Dim tempStr As String
Dim strLen As Integer
TempStr=" "
StrLen=Len(xStr)
i=1
Do While i<=strLen/2
tempStr=tempStr+Mid(xStr,i,1)+Mid(xStr,strLen-i+1,1)
i=i+1
Loop
PickMid=tempStr
End Function
Private Sub Command1_Click( )
Dim FirstStr As String
FirstStr="abcdef"
Print PickMid(FirstStr)
End Sub
A. abcdef
B. afbecd
C. fedcba
D. defabc
[填空题]以下程序的功能是:程序运行后,单击命令按钮,输出结果为:
1 4 7
2 5 8
3 6 9
请填空。
Private Sub Command1_Click( )
Dim Arr(3,3)As Integer
For i = 1 To 3
For j = 1 To 3
Arr(i, j)= ______
Print Arr(i, j);
Next j
Print
Next i
End Sub
[填空题]
以下程序的功能是在程序运行后,单击命令按钮,输出如下结果:
1 4 7
2 5 8
3 6 9
请完善以下程序。
Private Sub Command1_Click( )
Dim Arr(3,3)As Integer
For i=1 To 3
For j=1 To 3
Arr(i,j)=()
Print Arr(i,j);
Next j
Print
NeXt i
End Sub
[单项选择]以下程序运行后,单击按钮输出结果是
Private Sub Commandl_Click( )
Dim x As Integer,y As Integer,z As Integer
X=4:y=2: Z=3
Call Gopd(x,x,z)
Print x;X;Z
Call Gopd(x,y,y)
Print x;y;y
End Sub
Private Sub Gopd(x As Integer,y As Integer,z As Integer)
X=3 * Z + 1
y=2 * z
z=x + y
End Sub
A. 6 6 12
B. 8 5 10
C. 9 6 12
D. 8 10 10
[单项选择]以下程序运行后,单击按钮输出结果是( )。
Private Sub Commandl_Click( )
Dim x As Integer,y As Integer,z As Integer
X=4:y=2: Z=3
Call Gopd(x,x,z)
Print x;X;Z
Call Gopd(x,y,y)
Print x;y;y
End Sub
Private Sub Gopd(x As Integer,y As Integer,z As Integer)
X=3 * Z + 1
y=2 * z
z=x + y
End Sub
[单项选择]单击命令按钮时,下列程序代码的执行结果为______。 Private Function PickMid(xStr As String) As String Dim tempStr As String Dim strLen As Integer tempStr=“” strLen=Len(xStr) i=1 Do While i<=strLen/2 tempStr=tempStr+Mid(xStr,i,1)+Hid(xStr,strLen-i+1,1) i=i + 1 Loop PickMid=tempStr End Function Private Sub Command1_Click( ) Dim FirstStr As String FirstStr=“abcdef” Print PickMid(FirstStr) End Sub
A. abcdef
B. afbecd
C. fedcba
D. defabc
[单项选择]单击命令按钮时,下列程序代码的执行结果为______。 Private Function FirProc (x As Integer,y As Integer,z As Integer) FirProc=2*x+y+3*z End Function Private Function SecProc(x As Integer,y As Integer,z As Integer) SecProc=FirProc(z,x,y)+x End Function Private Sub Command1_Click( ) Dim a As Integer Dim b As Integer Dim C As Integer a=2 b = 3 c = 4 Print SecProc(c,b,a) End Sub
A. 21
B. 19
C. 17
D. 34