求vb编程改错题
如图所示,有错的地方已经指出,求懂vb的大佬解出。(文科生不懂编程,应付考试)Privatesubcommand1_Click()Dima,b,cFori=100to90...
如图所示,有错的地方已经指出,求懂vb的大佬解出。(文科生不懂编程,应付考试)
Private sub command1_Click()
Dim a,b,c
For i = 100 to 900
a=Int(i/100)
下行有错
b=Int(i-a * 100)
c=i Mod 10
If a * 100+b * 10+c=a^3+b^3+c^3 Then
下行有错
print a * 100+b * 10+c
End If
Print
Next i
End sub 展开
Private sub command1_Click()
Dim a,b,c
For i = 100 to 900
a=Int(i/100)
下行有错
b=Int(i-a * 100)
c=i Mod 10
If a * 100+b * 10+c=a^3+b^3+c^3 Then
下行有错
print a * 100+b * 10+c
End If
Next i
End sub 展开
1个回答
展开全部
Private Sub Command1_Click()
Dim a As Integer, b As Integer, c As Integer, i As Integer
For i = 100 To 900
a = Int(i / 100)
'下行有错
b = (i - a * 100) \ 10
c = i Mod 10
If a * 100 + b * 10 + c = a ^ 3 + b ^ 3 + c ^ 3 Then
'下行有错
Print a * 100 + b * 10 + c
End If
Next i
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询