vb组合数公式
发布网友
发布时间:2022-04-25 23:08
我来回答
共1个回答
热心网友
时间:2022-06-18 13:18
Mole Mole1
Private Sub fac(ByVal x As ULong,ByRef y As ULong)
Dim i&,a&
a = 1
For i = 1 To x
a = a * i
Next i
y = a
End Sub
Sub Main()
Dim m&,n&,Cmn&,c1&,c2&,c3&
Console.WriteLine("m=")
m = Val(Console.ReadLine())
Console.WriteLine("n=")
n = Val(Console.ReadLine())
Call fac(m,c1) :Call fac(n,c2) :Call fac(m - n,c3)
Cmn = c1 / (c2 * c3)
Console.Write("Cmn={0}",Cmn)
End Sub
End Mole