;package statkstring
;import static java.nio.file.Files.copy
;import static java.nio.file.Files.size
.*;import java.util
;import static javax.swing.text.html.HTML.Tag.S
}public class StatkString
}(public static void main(String[] args
; () < Stack<String> S = new Stack<String
;( Scanner s = new Scanner(System.in
; ()int N=s.nextInt
;int Top = 0
;String str = null
//read an expression --> string
;( " System.out.println("Enter your string
; () String sym=s.next
//for each symbol in the expression //
}(++ for (int i=0; i<N; i
;( sym = str.charAt(i
;(switch (sym
}
: ")" case
( if(Top== N-1
;( "System.out.println("stack is full
} else
;Top= Top+1
;(S.set(Top, str
{
:"(" case
; String pop = null
}"(" =! while (pop
; str=pop
{
:"+" case
} ( ("+") if (str.equals
;() String firstN = S.pop
;()String secondN =S.pop
;{( S.push(secondN+firstN
{" - " case
} ( ("-") if (str.equals
;() String firstN = S.pop
;()String secondN =S.pop
;{( S.push(secondN-firstN
: "*" case
} ( ("*") if (str.equals
;() String firstN = S.pop
;()String secondN =S.pop
;{( S.push(secondN*firstN
:"/" case
} ( ("/") if (str.equals
;() String firstN = S.pop
;()String secondN =S.pop
;{( S.push(secondN+firstN
default:
// if oprand copy to RP
{{{