Solve:
hate*love=rapport
What digit is not in the solution?
As the solution is
1293 * 5603 = 7244679
the answer is 8.
For h = 1 To 9
If used(h) = 0 Then
used(h) = 1
For l = 1 To 9
If used(l) = 0 Then
used(l) = 1
For a = 0 To 9
If used(a) = 0 Then
used(a) = 1
For t = 0 To 9
If used(t) = 0 Then
used(t) = 1
For e = 0 To 9
If used(e) = 0 Then
used(e) = 1
hate = 1000 * h + 100 * a + 10 * t + e
For o = 0 To 9
If used(o) = 0 Then
used(o) = 1
For v = 0 To 9
DoEvents
If used(v) = 0 Then
used(v) = 1
love = 1000 * l + 100 * o + 10 * v + e
rapport = hate * love
If rapport > 999999 And rapport < 10000000 Then
r$ = LTrim(Str(rapport))
If Mid(r, 1, 1) = Mid(r, 6, 1) And Mid(r, 3, 1) = Mid(r, 4, 1) Then
If used(Val(Mid(r, 1, 1))) = 0 And used(Val(Mid(r, 3, 1))) = 0 Then
If Val(Mid(r, 2, 1)) = a And Val(Mid(r, 5, 1)) = o And Val(Mid(r, 7, 1)) = t Then
Text1.Text = Text1.Text & hate & Str(love) & " " & rapport & crlf
End If
End If
End If
End If
used(v) = 0
End If
Next
used(o) = 0
End If
Next
used(e) = 0
End If
Next
used(t) = 0
End If
Next
used(a) = 0
End If
Next
used(l) = 0
End If
Next
used(h) = 0
End If
Next
|
Posted by Charlie
on 2018-05-06 18:18:45 |