不好意思,我上面的注释有点小问题,改为如下
one '第一个两位数
two '第二个两位数
one_two  'one-two后的两位数
ret   '结果
这个题目也就是要求所使用的数字不能相同,0到9这十个数字只能使用一次,而且结果要和前面所说的。

解决方案 »

  1.   

    同为数学爱好者,给你一个稍简单的代码:' suppose the five num is a,b,c,d,e. As a-b=c , c/d=e,e>=10 and d>=2,we can know that c>=20. As b>=10,we know that a>=30
    Private Sub Command1_Click()
    Dim a As Integer, b As Integer, c As Integer, e As Integer
    For a = 30 To 99
    For b = 10 To a - 20 ' because a-b>=20
    c = a - b
    For e = 10 To 45 ' because d*e<100 and d>=2
    If c Mod e = 0 Then
    If isrepeat(a, b, c, c / e, e) = False Then
    Debug.Print a & "-" & b & "=" & c & vbTab & c & "/" & c / e & "=" & e
    End If
    End If
    Next
    Next
    Next
    End SubFunction isrepeat(ParamArray a()) As Boolean
    Dim temp As String, i As Integer, num As String
    isrepeat = FASLE
    temp = Join(a, "")
    For i = 1 To Len(temp)
    num = Mid(temp, i, 1)
    If UBound(Split(temp, num)) > 1 Then isrepeat = True: Exit Function
    Next
    End Function