/* -*- coding: utf-8 -*- * * 49.cc: No.49 算数の宿題 - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ /* typedef */ /* global variables */ /* subroutines */ int num(string &s, int &pos) { int n = 0; while (pos < s.size() && s[pos] >= '0' && s[pos] <= '9') n = n * 10 + s[pos++] - '0'; return n; } /* main */ int main() { string s; cin >> s; int pos = 0; int n0 = num(s, pos); while (pos < s.size()) { char op = s[pos++]; int n1 = num(s, pos); n0 = (op == '*') ? n0 + n1 : n0 * n1; } printf("%d\n", n0); return 0; }