VB求组合数
求组合数C(m,n)n!/(m!(n-m)!) m6,n10
Private Function fact(x As Integer) As LongDim i As Integer, f As Longf 1For i 1 To xf f * iNext ifact f
End Function
Private Sub Command1_Click()Dim m%, n%, u As Long, v As Long, w As Longm 6: n 10u fa…
#include<stdio.h>
int main()
{int i 0;int j 0;int n 0;int tag 0;//设置一个标志位,不为素数时令tag1;printf("输入一个数:");scanf("%d", &n);for (i 2; i < n; i){if (n % i 0){printf("该…