ONP  Transform the Expression
Transform the algebraic expression with brackets into RPN form (Reverse Polish Notation). Twoargument operators: +, , *, /, ^ (priority from the lowest to the highest), brackets ( ). Operands: only letters: a,b,...,z. Assume that there is only one RPN form (no expressions like a*b*c).
Input
t [the number of expressions <= 100] expression [length <= 400] [other expressions]
Text grouped in [ ] does not appear in the input file.
Output
The expressions in RPN form, one per line.
Example
Input: 3 (a+(b*c)) ((a+b)*(z+x)) ((a+t)*((b+(a+c))^(c+d))) Output: abc*+ ab+zx+* at+bac++cd+^*
hide comments
omantere:
20180818 17:30:55
AC in one go! :) Used trees though not very fast... 

cod_r:
20180807 21:11:50
I wrote the code in c++, and for fast input/output, i often use


nimish_1:
20180804 22:32:37
my code is running correctly for given test cases but on submitting showing wrong ans. any particular test case for which I should check. 

miljanapet:
20180629 15:00:45
Last edit: 20180629 15:08:46 

itachi_2016:
20180608 00:29:38
Last edit: 20180608 00:53:12 

daya:
20180512 19:26:46
my code got AC for the test case a+bc whose output is abc+ , but i think the output should be ab+c , which one is correct ? 

deena101:
20180411 08:04:40
this is bery easy


x0r19x91:
20180322 15:05:30
0.00 sec in ASM 

hello_world123:
20180317 09:40:34
Solved without stack data structure !!!


stevefan1999:
20180208 10:16:33
You can try the Shunting Yard approach, or even go for RD parsing using a LL(k) grammar.

Added by:  mima 
Date:  20040501 
Time limit:  5s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: NODEJS PERL6 VB.NET 
Resource:   