更多"在窗体上画一个命令按钮,然后编写如下程序: Function fun"的相关试题:
[填空题]在窗体上画一个命令按钮,然后编写如下程序:
Function fun (ByVal num As Long) As Long
Dim k As Long
k=1
num=Abs(num)
Do While num
k=k*(num/10)
num=num/10
Loop
fun=k
End Function
Private Sub Command1_Click( )
Dim n As Long
Dim r As Long
n=InputBox(“请输入一个数”)
n=CLng(n)
r=fun(n)
MsgBox r
End Sub
程序运行后,单击命令按钮,在输入对话框中输入234,消息框显示的结果为
【14】 。
[填空题]在窗体上画一个命令按钮,然后编写如下程序:
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=InputBox(“请输入一个数”)
n=CLng(n)
r=fun(n)
Print r
End Sub
程序运行后,单击命令按钮,在输入对话框中输入“345”,输出结果为 【10】 。
[填空题]在窗体上画一个命令按钮,然后编写如下程序:
Function fun(ByVal num As Long)As Long
Dim k As Long
k=1
num=Abs(num)
Do While num
k=k*(num/10)
num=num/10
Loop
fun=k
End Function
Private Sub Command1_Click( )
Dim n As Long
Dim r As Long
n=InputBox("请输入一个数")
n=CLng(n)
r=fun(n)
MsgBox r
End Sub
程序运行后,单击命令按钮,在输入对话框中输入234,消息框显示的结果为______。
[单项选择]在窗体上画一个命令按钮,然后编写如下程序:
Function fun1(ByVal Bum As Long)As Long
Dim k As Long
k=0
Bum=AbsfBum)
Do While Bum
k=k+(Bum Mod 10)
Bum=Bum/10
Loop
fun1=k
End Function
Private Sub Command1_Click( )
Dim n As Long
n=InputBox("请输入一个数")
Print fun1(n)
End Sub
程序运行后,单击命令按钮,在输入对话框中输入234,输出结果为______。
A. 3
B. 4
C. 9
D. 10
[单项选择]在窗体上画一个命令按钮,然后编写如下程序: Function funl(ByVal Bum As Long)As Long Dim k As Long k = 0 Bum=Abs(Bum) Do While Bum k=k+(Bum Mod 10) Bum=Bum/10 Loop fun1=k End Function Private Sub Command1_Click( ) Dim n As Long n=InputBox("请输入一个数") Print fun1(n) End Sub 程序运行后,单击命令按钮,在对话框中输入234,输出的结果为
A. 3
B. 4
C. 9
D. 10