Advertisement
m4hd1r

Untitled

Aug 27th, 2011
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Dim a As Long
  2. Dim b As Long
  3. Dim c As Long
  4. Dim n As Long
  5. Dim t1 As String
  6. Dim t2 As String
  7. Dim g As String
  8. Dim r As Integer
  9.  
  10.  
  11. Private Sub Command1_Click()
  12.  
  13. r = 1
  14. t1 = TimeValue(Now)
  15.  n = Val(Text1)
  16.  
  17.  
  18. For a = 1 To n/2
  19. If n / a = n \ a Then
  20.  
  21.  
  22.        
  23.         For b = 1 To n / a
  24.         If n / b = n \ b Then
  25.        
  26.        
  27.                
  28.                
  29.                 For c = 1 To n / (b * a)
  30.                 If n / c = n \ c Then
  31.                
  32.                
  33. '---------------------------------------------------------------'
  34. 1  If a * b * c = n Then                                '
  35. g = g & vbNewLine & Str(r) & vbTab & a & vbTab & b & vbTab & c  '
  36. r = r + 1                                                       '
  37.   End If                                                       '
  38. '---------------------------------------------------------------'
  39.                
  40.                
  41.                 End If
  42.                 Next c
  43.                
  44.        
  45.         End If
  46.         Next b
  47.        
  48.  
  49. End If
  50. Next a
  51. Text2 = g
  52.  
  53. t2 = TimeValue(Now)
  54.  
  55.     Label1 = t1
  56.     label4 = t2
  57.  
  58.  
  59.  
  60. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement