//乘法 #include<iostream> #include<string> #include<stack> using namespace std;
string add(string x,string y) {
int xlen=x.length(); int ylen=y.length(); stack<int> answer; int c=0; while(xlen>0 || ylen>0) { int a = xlen>0 ? x[xlen-- -1]-'0' : 0; int b = ylen>0 ? y[ylen-- -1]-'0' : 0; int tmp = a+b+c; answer.push(tmp%10); c = tmp/10; } string res=""; if(c!=0) res+=char('0'+c); while(!answer.empty()) { res+=char('0'+answer.top()); answer.pop(); } return res; }
string mul(string x,char y) { string res; int b = y-'0'; int c = 0; for(int i=x.length()-1;i>=0;i--) { int a = x[i]-'0'; int tmp = a * b + c; res = char(tmp%10+'0') +res; c = tmp/10; } if(c!=0) res = char(c+'0') +res; return res; }
int main(){ string x,y; cin>>x>>y; int xlen=x.length(); int ylen=y.length(); string res="0"; for(int i=y.length()-1;i>=0;i--) { string tmp = mul(x,y[i]); for(int j=0;j<ylen-i-1;j++) { tmp+="0"; } res = add(res,tmp); } cout<<res<<endl; return 0; }