Private Sub Command1_Click()
For i = 100 To 999
If (i Mod 100) ^ 3 + (i \ 10 Mod 10) ^ 3 + (i \ 100) ^ 3 = i Then Exit For
Next i
Print "第一个水仙花数是:"; i
End Sub
Private Sub Command1_Click()
Dim a As Integer, b As Integer, c As Integer
For i = 100 To 999 Step 1
a = i \ 100
b = (i - 100 * a) \ 10
c = i - 100 * a - 10 * b
If a ^ 3 + b ^ 3 + c ^ 3 = i Then
Print i;
exit for
End If
Next i
End Sub