python水仙花代码(水仙花数vb代码)
导读 错的不是这条语句,而是其他的,而且错得离谱。下面是正确的: Private Sub Command1_Click() Dim i As Integer, a As Integer...
错的不是这条语句,而是其他的,而且错得离谱。
下面是正确的: Private Sub Command1_Click() Dim i As Integer, a As Integer, b As Integer, c As Integer, st As String For a = 1 To 9 For b = 0 To 9 For c = 0 To 9 i = a * 100 + b * 10 + c If i = a ^ 3 + b ^ 3 + c ^ 3 Then st = i & " = " & a & "^3 + " & b & "^3 + " & c & "^3" List1.AddItem st End If Next c Next b Next a End Sub。
免责声明:本文由用户上传,如有侵权请联系删除!