一个编程题,麻烦大侠们看看!
已知24有八个正整数因子:1、2、3、4、6、8、12、24,而24正好被其因子个数8整除,
求150-350之间能被其因子数目整除的个数

解决方案 »

  1.   

     Dim intloop As Integer
        Dim intFactorLoop As Integer
        Dim intFactorTotal As Integer
        Dim intNumTotal As Integer
        
        
        For intloop = 150 To 350
            For intFactorLoop = 1 To intloop
                If intloop Mod intFactorLoop = 0 Then intFactorTotal = intFactorTotal + 1
            Next
            If intloop Mod intFactorTotal = 0 Then intNumTotal = intNumTotal + 1
            
            intFactorTotal = 0
        Next
        
      

  2.   

    intNumTotal   就是所求的个数