问题:abcd*4=dcba 求出abcd各为多少? vb代码设计: private Sub form_load() show Dim a = as long Dim b = as long Dim c = as long Dim d = as long for a = 1 to 9 next a for b = 1 to 9 next b for c = 1 to 9 next c for d = 1 to 9 next d if(1000*a+100*b+10*c+d)*4=(1000*d+100*c+10*b+a) then print a,b,c,d end if end sub
Private Sub Form_Activate() Dim a, b, c, d For a = 0 To 9 For b = 0 To 9 For c = 0 To 9 For d = 0 To 9 If (a * 1000 + b * 100 + c * 10 + d) * 4 = d * 1000 + c * 100 + b * 10 + a Then Print a, b, c, d Next d, c, b, a End Sub