All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 If you go (Posted on 2015-11-18)
From Mexico to China

Solve 2 independent alphametics:

MEXICO/CHINA=IF
and
MEXICO/CHINA=GO

Evaluate F/G.

 No Solution Yet Submitted by Ady TZIDON No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution | Comment 1 of 2
```MEXICO CHINA IF
387120 24195 16    6
963140 48157 20    2
GO

F/G = 6/2 = 3
```
DefDbl A-Z
Dim crlf\$, dig(9)

Form1.Visible = True

Text1.Text = ""
crlf = Chr\$(13) + Chr\$(10)

d\$ = "0123456789": h\$ = d\$
Do
DoEvents

If InStr(d, "0") > 1 And InStr(d, "0") <> 4 Then
mexico = Val(Left(d, 6))
china = Val(Mid(d, 5, 1) + Mid(d, 7, 1) + Mid(d, 4, 1) + Mid(d, 8, 2))
q = Mid(d, 4, 1) + Mid(d, 10, 1)
If q * china = mexico Then Text1.Text = Text1.Text & mexico & Str(china) & Str(q) & "    " & q Mod 10 & crlf
End If

permute d
Loop Until d = h

Do
DoEvents

If InStr(d, "0") > 1 And InStr(d, "0") <> 10 Then
mexico = Val(Left(d, 6))
china = Val(Mid(d, 5, 1) + Mid(d, 7, 1) + Mid(d, 4, 1) + Mid(d, 8, 2))
q = Mid(d, 10, 1) + Mid(d, 6, 1)
If q * china = mexico Then Text1.Text = Text1.Text & mexico & Str(china) & Str(q) & "    " & q \ 10 & crlf
End If

permute d
Loop Until d = h

Text1.Text = Text1.Text & crlf & " done"

End Sub

 Posted by Charlie on 2015-11-18 16:12:10

 Search: Search body:
Forums (0)