以下程式在输入1*(2+3)*4-5时,输出应为123+*4*5-,可是却是输出123+*4-5*
请问要怎么修改才行呢...?
Dim length As Integer = Len(TextBox1.Text) 'textbox1主要是放输入的中序式
Dim i As Integer
Dim top As Integer = -1
Dim v As String
Dim Postfix_string As String '后序式字串
Dim stack(length) As Char '堆叠
v = TextBox1.Text
i = 0
While i < length
Select Case v(i)
Case "(" '当遇到(直接压入堆叠
top += 1
stack(top) = v(i)
Case ")" '遇到)时,堆叠作POP,直到遇到(
Wh ..
访客只能看到部份内容,免费 加入会员 或由脸书 Google 可以看到全部内容