1个回答
展开全部
Sub s()
Const a = "123456789"
For i = 1 To 9
b = Replace(a, i, "")
For j = 1 To 8
x = Mid(b, j, 1)
c = Replace(b, x, "")
xx = i * 10 + Val(x)
p c, xx, 1, 0
Next j, i
End Sub
Sub p(a, x, k, y)
For i = 1 To Len(a)
xx = Mid(a, i, 1)
yy = y * 10 + Val(xx)
b = Replace(a, xx, "")
Z = x * yy
If k = 2 And x < yy Then
For j = 1 To 5
xx1 = Mid(b, j, 1)
cc = Replace(b, xx1, "")
For jj = 1 To 4
xx2 = Mid(cc, jj, 1)
xx = xx1 * 10 + xx2
If Z Mod xx = 0 Then
zz = Z / xx
If zz < 1000 And zz > 100 Then
c = Replace(cc, xx2, "")
For jjj = 1 To 3
c = Replace(c, Mid(CStr(zz), jjj, 1), "")
Next
If c = "" Then
Debug.Print x; "X"; yy; "="; xx; " X"; zz
End If
End If
End If
Next jj, j
Else
p b, x, k + 1, yy
End If
Next
End Sub
Const a = "123456789"
For i = 1 To 9
b = Replace(a, i, "")
For j = 1 To 8
x = Mid(b, j, 1)
c = Replace(b, x, "")
xx = i * 10 + Val(x)
p c, xx, 1, 0
Next j, i
End Sub
Sub p(a, x, k, y)
For i = 1 To Len(a)
xx = Mid(a, i, 1)
yy = y * 10 + Val(xx)
b = Replace(a, xx, "")
Z = x * yy
If k = 2 And x < yy Then
For j = 1 To 5
xx1 = Mid(b, j, 1)
cc = Replace(b, xx1, "")
For jj = 1 To 4
xx2 = Mid(cc, jj, 1)
xx = xx1 * 10 + xx2
If Z Mod xx = 0 Then
zz = Z / xx
If zz < 1000 And zz > 100 Then
c = Replace(cc, xx2, "")
For jjj = 1 To 3
c = Replace(c, Mid(CStr(zz), jjj, 1), "")
Next
If c = "" Then
Debug.Print x; "X"; yy; "="; xx; " X"; zz
End If
End If
End If
Next jj, j
Else
p b, x, k + 1, yy
End If
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询