AB° Celsius ≅ BA° Fahrenheit
2*CD° Celsius ≅ DC° Fahrenheit
How much is A+B+C+D?
Rem: XY denotes 10*X+Y
16°C rounds to 61°F, but 28°C also rounds to 82°F. We can ignore 04.4°C(rounds to 4°C) rounding to 40°F. So AB may be either 16 or 28.
But we seem forced into a leading zero for 2 * 05°C = 10°C = 50°F.
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For f = 11 To 99
d1 = f \ 10: d2 = f Mod 10
f1 = f - 0.5: f2 = f + 0.5
c1 = Int((f1 - 32) * 5 / 9 + 0.5)
c2 = Int((f2 - 32) * 5 / 9 + 0.5)
If c1 = 10 * d2 + d1 Or c2 = 10 * d2 + d1 Then
Text1.Text = Text1.Text & f & " " & c1 & Str(c2) & crlf
End If
Next f
Text1.Text = Text1.Text & crlf
For f = 12 To 98 Step 2
d1 = f \ 10: d2 = f Mod 10
f1 = f - 0.5: f2 = f + 0.5
c1 = Int((f1 - 32) * 5 / 18 + 0.5)
c2 = Int((f2 - 32) * 5 / 18 + 0.5)
If c1 = 10 * d2 + d1 Or c2 = 10 * d2 + d1 Then
Text1.Text = Text1.Text & f & " " & 2 * c1 & Str(2 * c2) & crlf
End If
Next f
Text1.Text = Text1.Text & crlf & " done"
End Sub
|
Posted by Charlie
on 2015-09-14 16:19:42 |