VB求组合数
'求组合数C(m,n)=n!/(m!(n-m)!) m=6,n=10
Private Function fact(x As Integer) As Long
Dim i As Integer, f As Long
f = 1
For i = 1 To x
f = f * i
Next i
fact = f
End Function
Private Sub Command1_Click()
Dim m%, n%, u As Long, v As Long, w As Long
m = 6: n = 10
u = fact(m)
v = fact(n)
w = fact(n - m)
Print v / (u * w)
End Sub