Write VB: "narcissus number" refers to a 3-digit number, the cube sum of each number is equal to the number, such as 153 = 1 ^ 3 + 5 ^ 3 + 3 ^ 3 It must be right Print out all the daffodils between 100 and 1000

Write VB: "narcissus number" refers to a 3-digit number, the cube sum of each number is equal to the number, such as 153 = 1 ^ 3 + 5 ^ 3 + 3 ^ 3 It must be right Print out all the daffodils between 100 and 1000


Private Sub Command1_ Click()
For i = 100 To 1000
g = Mid(i,1,1)
s = Mid(i,2,1)
b = Mid(i,3,1)
If i = g * g * g + s * s * s + b * b * b Then
Print i
End If
Next i
End Sub
one hundred and fifty-three
three hundred and seventy
three hundred and seventy-one
four hundred and seven
Just these four