If w = 1 Then
'1级
If j = 1 Then
If Mid(t1, 1, 1) = "(" Then
'323212132
p = Val(Mid(t1, 2, Len(t1)))
Else
p = Val(t1)
End If
If Mid(t1, b(1) + 1, 1) = "(" Then
'323212132
q = Val(Mid(t1, b(1) + 2, Len(t1)))
Else
q = Val(Mid(t1, b(1) + 1, Len(t1)))
End If
t1 = p * q
Else
If Mid(t1, 1, 1) = "(" Then
'323212132
p = Val(Mid(t1, 2, Len(t1)))
Else
p = Val(t1)
End If
If Mid(t1, b(1) + 1, 1) = "(" Then
'323212132
q = Val(Mid(t1, b(1) + 2, Len(t1)))
Else
q = Val(Mid(t1, b(1) + 1, Len(t1)))
End If
s = p * q
t1 = s & Mid(t1, b(2), Len(t1))
End If
ElseIf j = w And j > 1 Then
'1级
If Mid(t1, b(w - 1) + 1, 1) = "(" Then
p = Val(Mid(t1, b(w - 1) + 2, Len(t1)))
Else
p = Val(Mid(t1, b(w - 1) + 1, Len(t1)))
End If
If Mid(t1, b(w) + 1, 1) = "(" Then
q = Val(Mid(t1, b(w) + 2, Len(t1)))
Else
q = Val(Mid(t, b(w) + 1, Len(t)))
End If
s = p * q
If s1 Then
'1级
If Mid(t1, b(w - 1) + 1, 1) = "(" Then
p = Val(Mid(t1, b(w - 1) + 2, Len(t1)))
Else
p = Val(Mid(t1, b(w - 1) + 1, Len(t1)))
End If
If Mid(t1, b(w) + 1, 1) = "(" Then
q = Val(Mid(t1, b(w) + 2, Len(t1)))
Else
q = Val(Mid(t1, b(w) + 1, Len(t1)))
End If
s = p * q
If s < 0 Then
t1 = Mid(t1, 1, b(w - 1)) & "(" & s & ")" & Mid(t1, b(w + 1), Len(t1))
Else
t1 = Mid(t1, 1, b(w - 1)) & s & Mid(t1, b(w + 1), Len(t1))
End If
End If
|