十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
Module Module1
逊克网站制作公司哪家好,找创新互联建站!从网页设计、网站建设、微信开发、APP开发、响应式网站建设等网站项目制作,到程序开发,运营维护。创新互联建站自2013年起到现在10年的时间,我们拥有了丰富的建站经验和运维经验,来保证我们的工作的顺利进行。专注于网站建设就选创新互联建站。
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
Private Sub Command1_Click()
Dim A, B, C
A = 10
B = 3
C = f(A) / (f(B) * f(A - B))
Print C
End Sub
Private Function f(n)
Dim I As Integer
f = 1
For I = 1 To n
f = f * I
Next I
End Function
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