VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "完全数"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "计算完全数"
      Height          =   495
      Left            =   2640
      TabIndex        =   0
      Top             =   2400
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub Command1_Click()
    For n = 2 To 10000
        s = 0
        For i = 1 To n / 2
            If n Mod i = 0 Then s = s + i
        Next
        If s = n Then Print n
    Next
End Sub
