请问VB这道题的代码是什么?
1个回答
展开全部
Private Sub Command1_Click()
n = CInt(Text2)
m = CInt(Text1)
c = fac(n) / (fac(m) * fac(n - m))
Text3 = c
End Sub
Function fac(n)
f = 1
For i = 2 To n
f = f * i
Next i
fac = f
End Function
Private Sub Form_Load()
Text1 = ""
Text2 = ""
Text3 = ""
End Sub
n = CInt(Text2)
m = CInt(Text1)
c = fac(n) / (fac(m) * fac(n - m))
Text3 = c
End Sub
Function fac(n)
f = 1
For i = 2 To n
f = f * i
Next i
fac = f
End Function
Private Sub Form_Load()
Text1 = ""
Text2 = ""
Text3 = ""
End Sub
追问
太感谢了,我写了很久,一直都不对🤝
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询