|
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Int16
Dim j As Int16 = 0
Dim n As Int16 = 0
Dim part(300, 1) As Int64
Dim r As String Dim maxPart As Int16 = 1
Dim maxNum As Int64 = 10000000000
Dim maxWidth As Int16 = 10 ' Dim temp As Int16
Try
part(1, 0) = 1
For i = 1 To CType(Me.TextBox1.Text, Int16) For j = 1 To maxPart
part(j, 0) *= i
Next For j = 1 To maxPart If part(j, 0) > maxNum Then
n = j + 1
part(n, 0) = part(j, 0) \ maxNum + part(n, 0)
part(n, 1) = maxWidth + part(j, 1) part(j, 0) = part(j, 0) Mod maxNum
End If
Next
If maxPart < n Then maxPart += 1
n = 0
Next Catch ex As Exception
MsgBox(ex.Message & " " & maxPart.ToString & " ")
Finally
r = ""
Me.TextBox2.Text = ""
For j = 1 To maxPart r = part(j, 0).ToString
r = "," & New String("0", 10 - r.Length) & r
Me.TextBox2.Text = r & Me.TextBox2.Text
Next
End Try End Sub计算结果是:40238726,0077093773,5437024339,2300398571,9374864210,7146325437,9991042993,8512398629,0205920442,0848696940,4800479988,6101971960,5863166687,2994808558,9013238296,6994459099,7424504087,0737599188,2362772718,8732519779,5059509952,7612087497,5462497043,6014182780,9464649629,1056393887,4378864873,3711918104,5825783647,8499770124,7663288983,5955735432,5131853239,5846307555,7409114262,4174743493,4755342864,6576611667,7973966688,2029120737,9143853719,5882498081,2686783837,4559731746,1360853795,3452422158,6593201928,0908782973,0843139284,4403281231,5586110369,7680135730,4216168747,6096758713,4831202547,8589320767,1691324484,2623613141,2508780208,0002616831,5102734182,7977704784,6358681701,6436502415,3691398281,2648102130,9276124489,6359928705,1149649754,1990934222,1566832572,0808213331,8611681155,3615836546,9840467089,7560290095,0537616475,8477284218,8967964624,4945160765,3534081989,0138544248,7984959953,3191017233,5555660213,9450399736,2807501378,3761530712,7761926849,0343526252,0001588853,5147331611,7021039681,7592151090,7788019393,1781141945,4525722386,5541461062,8921879602,2383897147,6088506276,8629671466,7469756291,1234082439,2081601537,8088989396,4518263243,6716167621,7916890977,9911903754,0312746222,8998800519,5444414282,0121873617,4599264295,6581746628,3029555702,9902432415,3181617210,4658320367,8690611726,0158783520,7515162842,2554026517,0483304226,1439742869,3306169089,7968482590,1254583271,6822645806,6526769958,6526822728,0707578139,1858178889,6522081643,4834482599,3266043367,6601769996,1283186078,8386150279,4659551311,5655203609,3988180612,1385586003,0143569452,7224206344,6317974605,9468257310,3790084024,4324384656,5724501440,2821885252,4709351906,2092902313,6493273497,5655139587,2055965422,8749774011,4133469627,1542284586,2377387538,2304838656,8897646192,7383814900,1407673104,4664025989,9490222221,7659043399,0188601856,6526485061,7997023561,9389701786,0040811889,7299183110,2117122984,5901641921,0688843871,2185564612,4960798722,9085192968,1937238864,2614839657,3822911231,2502418664,9353143970,1374285319,2664987533,7218940694,2814341185,2015801412,3344828015,0513996942,9015348307,7644569099,0731524332,7828826986,4602789864,3211390835,0621709500,2597389863,5542771967,4282224875,7586765752,3442202075,7363056949,8825087968,9281627538,4886339690,9959826280,9561214509,9487170124,4516461260,3790293091,2088908694,2028510640,1821543994,5715680594,1872748998,0942547421,7358240106,3677404595,7417851608,2923013535,8081840096,9963725242,3056085590,3700624271,2434169090,0415369010,5933983835,7779394109,7002775347,2000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000,0000000000 |
|