生成一个随机数:n=int(rnd*101)+100 用Function写一个N! Private Function jc(N As integer) as Long if n= 0 or n=1 then JC=1 :exit function end if jc(n)=n*jc(n-1) End Function n取n-1、n、n+1 进行调用,楼主编写
大数计算 ```vb Function MultiplyBigIntegers(ByVal strNum1 As String, ByVal strNum2 As String) As String ' Pad shorter string with zeros If Len(strNum1) < Len(strNum2) Then strNum1 = String(Len(strNum2) - Len(strNum1), "0") & strNum1 If Len(strNum2) < Len(strNum1) Then strNum2 = String(Len(strNum1) - Len(strNum2), "0") & strNum2 Dim result As String Dim carry As Integer ' Iterate through digits For i = Len(strNum2) - 1 To 0 Step -1 Dim temp As String carry = 0 For j = Len(strNum1) - 1 To 0 Step -1 Dim product As Integer product = CInt(Mid(strNum1, j + 1, 1)) * CInt(Mid(strNum2, i + 1, 1)) + carry carry = product \ 10 ' Integer division for carry temp = CStr(product Mod 10) & temp ' Remainder for current digit Next j If carry > 0 Then temp = CStr(carry) & temp result = String(Len(strNum2) - i - 1, "0") & temp + result Next i ' Remove leading zeros Do While Left(result, 1) = "0" And Len(result) > 1 result = Mid(result, 2) Loop MultiplyBigIntegers = result End Function```