Private Sub Command1_Click() Dim a As Integer, b As Integer, c a = Len(Text1.Text): b = 0 c = 1 Do While c <= a b = CInt(Mid(Text1.Text, c, 1) * 2 ^ (a - c)) + b c = c + 1 Loop Text2.Text = Str(b) End Sub
第2个回答 2016-06-09
只要改一个地方: b = b + Str(a mod 2) 改为: b = Str(a mod 2) + b