将1~9这九个数填入下列算式的九个方格中,使算式成立

1个回答

  • 174*32=58*96

    害我编代码算了半天

    Option Explicit

    Sub test()

    Dim i, j, l, k

    For i = 1 To 9

    For j = 1 To 9

    For l = 1 To 9

    If i j And i l And j l Then

    k = k + 1

    Sheet1.Range("a" & k).Value = Val(i & j & l)

    End If

    Next l

    Next j

    Next i

    End Sub

    Sub test2()

    Dim i, j, k

    For i = 1 To 9

    For j = 1 To 9

    If i j Then

    k = k + 1

    Sheet1.Range("b" & k).Value = Val(i & j)

    End If

    Next j

    Next i

    End Sub

    Sub test3()

    Dim i As Integer, j As Integer

    With Sheet1

    For i = 1 To 504

    For j = 1 To 72

    If .Range("a" & i) * .Range("b" & j) = 5568 Then Debug.Print .Range("a" & i); .Range("b" & j)

    Next j

    Next i

    End With

    End Sub

    Sub test4()

    Dim i As Integer, j As Integer

    With Sheet1

    For i = 1 To 71

    For j = i + 1 To 72

    If .Range("b" & i) * .Range("b" & j) = 5568 Then Debug.Print .Range("b" & i); .Range("b" & j)

    Next j

    Next i

    End With

    End Su