更多"假定有如下程序代码,程序运行后,把鼠标光标移到窗体内,每单击一次,变换"的相关试题:
[填空题]假定有如下程序代码,程序运行后,把鼠标光标移到窗体内,每单击一次,变换一种鼠标光标的形状,依次显示鼠标光标的15个属性。请在划线处将程序补充完整。
Private Sub Form_Click( )
Static x As Integer
Cls
Print"Mousepointer Property is now";x
Form1. 【12】 =x
x=x+1
If x=15 Then x=0
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)= 【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 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
[单项选择]有下列程序,程序运行后单击命令按钮,则输出的结果是( )。
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.
[单项选择]在窗体上画一个命令按钮,然后编写如下程序。运行后,单击命令按钮,输出结果为 ( )。
Private Sub Command4_Click( )
Dima As Integer,bASInteger
a=1
b=2
PrintN(a,b)
End Sub
Function N(X As Integer,yAsInteger)AsInteger
N=IIf(x>y,x,y)
End Funcfion
[单项选择]有下列程序,程序运行后单击命令按钮,则输出的结果为( )。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=";s2End SubFunction Factorial(a( )As Integer)Dim t#,i% t=1 For i=LBound(a)To UBound(a) t=t*a(i) Next i Factorial=tEnd Function
A. s1=360 s2=24
B. s1=24 s2=360
C. s1=24 s2=24
D. s1=360 s2=360
[单项选择]对窗体编写如下代码,当程序运行后,按回车键,输出结果为 ______。
Option Base 1
Private Sub Form KeyPress(KeyAscii As Integer)
a = Array(237,126,87,48,498)
m1 = all)
m2= 1
If KeyAscii = 13 Then
For i = 2 To 5
If a(i)>m1 Then
m1 = a(j)
m2= i
End If
Next i
End If
Print m1
Print m2
End Sub
A. 48
B. 237
C. 498
D. 498
[填空题]在窗体上画一个命令按钮,然后编写如下事件过程,程序运行后,单击命令按钮,输出结果是 【15】
Private Sub Command1_Click( )
Dim a(1 To 10)
Dim p(1 To 3)
k=5
For i = 1 To 10
a(i) = i
Next i
For i = 1 To 3
p(i) = a(i * i)
Next i
For i = 1 To 3
k=k+p(i) *2
Next i
Print k
End Sub
[单项选择]在窗体画一个命令按钮,然后编写如下过程,程序运行后,单击命令按钮,在输入对话框中输入234,输出结果为 ______。 Function Fun(ByVal num As Long)As Long Dim k As Long k=1 num=Abs(num) Do While num k=k* (num Mod 10) num=num/10 Loop fun=k End Function Private Sub Command1_Click( ) Dim n As Long Dim r As Long n=In put Box("请输入一个数") n=CLng(n) r=Fun(n) Print r End Sub
A. 20
B. 24
C. 9
D. 28