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

Home > Numbers
If you go (Posted on 2015-11-18) Difficulty: 4 of 5
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.)
Solution 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)


Private Sub Form_Load()
 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
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (16)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information