#include using namespace std; typedef long long ll; #define rep(i,n) for(i=0;i> s; int n=s.size(); int i; int ans=0; int st=0; char op='*'; s+='*'; rep(i,n){ if(s[i]=='+' || s[i]=='*'){//演算器号が来たら op=s[i];//記号を保存 st=i+1; } else{ if(s[i+1]=='+' || s[i+1]=='*'){ string t=s.substr(st,i+1-st); int tt=atoi(t.c_str()); if(op=='*') ans+=tt; else ans*=tt; //cout << t<