#include using namespace std; int operate(char op) { int a = 0,b; char c; for(int j = 0; j < 2; j++) { b = a; cin >> c; if(cin.eof()) { return a; } if(c != '+' && c != '-' && c != '*') { a = c - 48; } else { a = operate(c); } } switch(op) { case '+': return b+a; break; case '-': return b-a; break; case '*': return b*a; break; } } int main() { cout << operate(0) << endl; return 0; }