求帮忙,编写程序求 n!(n的阶层)小于等于20000是的最大n值
求帮忙,编写程序求 n!(n的阶层)小于等于20000是的最大n值!!不会呀~~
Dim n As Integer,i As Integer,j As Integer n=1 For i=1 to 100 For j=1 to i n=n*j Next j if(n>20000) Then Exit For n=1 Next i print i-1 'i-1就是要求的数
Private Sub Form_Load() '运行时将窗体的Autoredraw属性设置为true,结果是7 Dim n As Long, i As Integer, j As Integer 'Integer不够大,改为long就OK n = 1 For i = 1 To 100 For j = 1 To i n = n * j Next j If (n > 20000) Then Exit For n = 1 Next i Print i - 1 'i-1就是要求的数 End Sub