大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
Module Module1
杜集网站建设公司成都创新互联公司,杜集网站设计制作,有大型网站制作公司丰富经验。已为杜集1000+提供企业网站建设服务。企业网站搭建\成都外贸网站建设公司要多少钱,请找那个售后服务好的杜集做网站的公司定做!
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 Module
Module Module1
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 Module
Public Class Form1
Private Function jc1(ByVal q)
Dim i%, p%
p = 1
For i = 1 To q Step 1
p = p * i
Next
Return p
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim m!, n!, info1$, info2, C!, title$
title = "组合数计算小能手"
info1 = "请输入m的值"
info2 = "请输入n的值"
m = Val(InputBox(info1, title))
n = Val(InputBox(info2, title))
C = jc1(m) / jc1(n) / jc1(m - n)
Label1.Text = "结果是" " " C
End Sub