class Solution {
public:
inline bool isdig(string s){
char c = s[0];
if(s.size()>1){
return true;
}
if(c=='+' || c=='-' || c=='/' || c == '*'){
return false;
}
return true;
}
int evalRPN(vector<string>& tokens) {
stack<int> st;
for(string& s:tokens){
if( isdig(s) ){
st.push( stoi(s) );
}else{
int b = st.top();
st.pop();
int a = st.top();
st.pop();
if( s[0]=='+' ){
st.push(a+b);
}else if(s[0]=='-'){
st.push(a-b);
}else if( s[0]=='*' ){
st.push(a*b);
}else{
st.push(a/b);
}
}
}
return st.top();
}
};