vb四叶玫瑰数
DimaAsInteger,bAsInteger,cAsInteger,dAsIntegerPrivateSubCommand1_Click()Fori=1001To99...
Dim a As Integer, b As Integer, c As Integer, d As Integer
Private Sub Command1_Click()
For i = 1001 To 9999 Step 1
a = i / 1000
b = (i - a * 1000) / 100
c = (i - a * 1000 - b * 100) / 10
d = i - a * 1000 - b * 100 - c * 10
If a ^ 4 + b ^ 4 + c ^ 4 + d ^ 4 = i Then
Picture1.Print i
End If
Next i
End Sub
为什么没有数出来,哪里出错了 展开
Private Sub Command1_Click()
For i = 1001 To 9999 Step 1
a = i / 1000
b = (i - a * 1000) / 100
c = (i - a * 1000 - b * 100) / 10
d = i - a * 1000 - b * 100 - c * 10
If a ^ 4 + b ^ 4 + c ^ 4 + d ^ 4 = i Then
Picture1.Print i
End If
Next i
End Sub
为什么没有数出来,哪里出错了 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询