Private Sub Command1_Click()
s = Text1.Text
s0 = 0
s1 = 0
x = 0
For i = 1 To Len(s)
x = x * 2
If Mid(s, i, 1) = "0" Then s0 = s0 + 1
If Mid(s, i, 1) = "1" Then s1 = s1 + 1: x = x + 1
Next i
Print "0的个数是:"; s0
Print "1的个数是:"; s1
Print s; "=("; Trim(Str(x)); ")2"
End Sub