How to insert parenthesis in an infix expression in C/C++

后端 未结 0 1792
再見小時候
再見小時候 2021-01-15 05:03

I need an algorithm to insert parenthesis in an infix expression. example:

input:   -4 + 5 % 2 * 1.7 (2+16)   
output:  ( (-4)+( ((5%2)*1.7)*(2+16) ) )


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题