The largest palindrome expressable as a product of two 2-digit numbers is
9009 = 91 × 99.
What is the largest palindrome that is a product of two 3-digit numbers?
Source: Project Euler.
913 993 906609
are the last "factor factor product" set from
DefDbl A-Z
Dim fct(20, 1), crlf$
Private Sub Form_Load()
Text1.Text = ""
crlf$ = Chr(13) + Chr(10)
Form1.Visible = True
For a = 100 To 999
For b = a To 999
pr = a * b
ps$ = LTrim$(Str(pr))
pal = 1
For i = 1 To Len(ps) / 2
If Mid(ps, i, 1) <> Mid(ps, Len(ps) + 1 - i, 1) Then pal = 0: Exit For
Next
If pal Then
If pr >= Max Then
Max = pr
Text1.Text = Text1.Text & a & Str(b) & Str(pr) & crlf
End If
DoEvents
End If
Next
Next
Text1.Text = Text1.Text & "done"
DoEvents
End Sub
|
Posted by Charlie
on 2015-04-27 19:23:24 |