实现上述功能的 VB 程序如下,请在划线处填入合适的代码
Private Sub
Command1_Click
Dim s As String,
ch As String, sum As Integer
Dim fh As Integer
s = Text1.Text:
fh = 1: p = 0: sum=0
For i = 1 To
Len(s)
ch = Mid(s, i, 1)
If ch >=
"0" And ch <= "9" Then
p =
Else
sum =
p = 0
If ch =
"-" Then
fh = -1
ElseIf ch =
"+" Then
fh = 1
End If
End If
Next i
Label1.Caption =
Str(sum)
End Sub