#include<iostream> using namespace std;main(){int r=0,v=0,l=0;char c;while(cin.get(c)){if(c>47){cout<<c;v=10*v+c-48;}else if(c<11){cout<<" = ";r+=v*(l==0)-v*(l>0);if(l<0)r*=v;cout<<r<<c;r=v=l=0;}else{cout<<' '<<c<<' ';r+=v*(l==0)-v*(l>1);if(l<0)r*=v;v=0;l=c-43;}}}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).