The user enters numbers and brackets separated by spaces (there is always a closed one for each open bracket). For example, 18 7 ( 5 3 ) 2 . The algorithm should make a normal equation from this set and give out 18=7+(5-3)*2 There is only +, -, *, =, other actions are not used. The procedure in the equation is not standard - at the beginning, what is in brackets, and then from left to right. For example, 3 + 3 * 5 would be 30.
Language is not important, the main thing is to invent the algorithm itself. Does anyone have any ideas?