Private Sub Form_Click() Dim I As Integer, K As Integer Print "100-999之间的水仙花数:" For I = 100 To 999 If (I Mod 10) ^ 3 + (I \ 10 Mod 10) ^ 3 + (I \ 100) ^ 3 = I Then Print I; K = K + 1 End If Next Print Print "共有"; K; "个"End Sub
已经运行过。有什么问题请留言。