```
class Solution {
public:
int evalRPN(vector<string> &tokens)
{
int val = 0;
int rop;
int lop;
stack<int> alg;
for (int i=0; i<tokens.size();i++)
{
if("+"==tokens[i])
{
rop = alg.top();`enter code here`
alg.pop();
lop = alg.top();
alg.pop();
val = rop+lop;
alg.push(val);
}
else if("-"==tokens[i])
{
rop = alg.top();
alg.pop();
lop = alg.top();
alg.pop();
val = rop-lop;
alg.push(val);
}
else if("*"==tokens[i])
{
rop = alg.top();
alg.pop();
lop = alg.top();
alg.pop();
val = rop*lop;
alg.push(val);
}
else if("/"==tokens[i])
{
rop = alg.top();
alg.pop();
lop = alg.top();
if(lop==0)
{
cout<<"Divisor cannot be zero!"<<endl;
exit(1);
}
alg.pop();
val = rop/lop;
alg.push(val);
}
else
{
alg.push(atoi(tokens[i].c_str()));
}
}
return alg.top();
}
```

};