"This special big number of mine allows me to get a correct answer of dividing it by 7 by simply erasing its second digit..." - declared Danny.
After a minute or two his father, W.G.
quipped: "I know what digit was erased!"
Do you?
Please post your reasoning.
105
1050
10500
105000
1050000
so the removed digit is zero.
from
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For m = 10 To 1000000
p = 7 * m
ms$ = LTrim(Str(m))
ps$ = LTrim(Str(p))
If Len(ps) > Len(ms) Then
If Left(ms, 1) = Left(ps, 1) And Mid(ms, 2) = Mid(ps, 3) Then
Text1.Text = Text1.Text & ps & crlf
End If
End If
DoEvents
Next
Text1.Text = Text1.Text & crlf & " done"
End Sub
|
Posted by Charlie
on 2018-01-12 19:33:39 |