Say a program receives an input string "8*10+6/2"
and should output 83
, in this case. how to handle the operator?
I can chop the string into individual strings, then detect whether it is a number or operator. If it is an operator I can convert it to int
. But I have no idea how to handle the operator so that the calculation works.