Private Sub Command1_Click()
Cls
Print "第一种方法:"
Dim a As Integer, b As Integer, c As Integer, d As Integer
For a = 1 To 9
For b = 0 To 9
For c = 0 To 9
d = 100 * a + b * 10 + c
If d = a ^ 3 + b ^ 3 + c ^ 3 Then Print d
Next c
Next b
Next a
End Sub
Private Sub Command2_Click()
Cls
Print "第二种方法:"
For i = 100 To 999
ge = i Mod 10
shi = i \ 10 Mod 10
bai = i \ 100
If ge ^ 3 + shi ^ 3 + bai ^ 3 = i Then Print i
Next i
End Sub