'------------------------- completely defined -------------------- ------ 'Let's take a look at 4 this, its real factor has 1, 2, and it is 3. Since 4 itself is larger than its true 'factor, such a number is called a profit number. Let's take another 12th, this real factor 'has 1, 2, 3, 4, 6, and it is 16. Since 12 itself is smaller than its real factor, this' number is called a loss. So there is no one who is neither surplus, no loss? Is there only the number of all the facts of all its true factors? Have. Such numbers are called complete numbers. '------------------------------------- --------------, for example: 6 can be removed by 1, 2, 3, while 1 2 3 = 6, so 6 is the minimum full number ', for example: 28 1, 2, 4, 7, 14, and 1 2 4 7 14 = 28 'Other Complete Number of: 496, 8128, 33550336Function Pd (X as Double) AS STRINGDIM I AS Doubledim Total as DoubleFor i = 1 TO X - 1 IF X MOD I = 0 THEN DOEVENTS TOTAL = Total I end ifnext Iif Total = x THEN PD = "Is full number" ELSE PD = "Not full number" End IFEND FUNCTION
PRIVATE SUB Command1_Click () MSGBOX Pd (Me.Text1.Text) End Sub