1. A/B=3
2. C/D=9 In both problems ( 1. and 2.) the union of the digits of numbers
A & B (or C & D) is the full set of 9 non-zero decimal digits.
List all existing solutions.
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
ChDir "C:\Program Files (x86)\DevStudio\VB\projects\flooble"
Text1.Text = ""
crlf$ = Chr(13) + Chr(10)
Form1.Visible = True
DoEvents
s$ = "123456789": h$ = s$
Do
a = Val(Left(s$, 5)): b = Val(Right(s$, 4))
'If a / b = Int(a / b) Then Text1.Text = Text1.Text & Str(a) & Str(b) & Str(a / b) & crlf
If a / b = 3 Then Text1.Text = Text1.Text & Str(a) & Str(b) & Str(3) & crlf
If a / b = 9 Then Text1.Text = Text1.Text & Str(a) & Str(b) & Str(9) & crlf
permute s$
Loop Until s$ = h$
Text1.Text = Text1.Text & crlf & " done"
End Sub
finds
17469/5823=3
17496/5832=3
57429/6381=9
58239/6471=9
75249/8361=9
|
Posted by Charlie
on 2014-09-05 18:14:59 |