早教吧作业答案频道 -->其他-->
请将阶乘的功能设计为过程,并在计算(9!+3!)*5!/(7!-4!)时进行调用
题目详情
请将阶乘的功能设计为过程,并在计算(9!+3!)*5!/(7!-4!)时进行调用
▼优质解答
答案和解析
Sub xx()
Dim x As Long
'(9!+3!)*5!/(7!-4!)
x = (jc(9) + jc(3)) * jc(5) / (jc(7) - jc(4))
Print x
End Sub
Public Function jc(n As Integer) As Long
Dim i As Integer,s As Long
s = 1
For i = 2 To n
s = s * i
Next
jc = s
End Function
Dim x As Long
'(9!+3!)*5!/(7!-4!)
x = (jc(9) + jc(3)) * jc(5) / (jc(7) - jc(4))
Print x
End Sub
Public Function jc(n As Integer) As Long
Dim i As Integer,s As Long
s = 1
For i = 2 To n
s = s * i
Next
jc = s
End Function
看了 请将阶乘的功能设计为过程,并...的网友还看了以下: