#include <bits/stdc++.h>
using namespace std;
string s,t;
struct LLI
{
int a[5000],len;
LLI(int x = 0)
{
memset(this->a,0,sizeof(this->a));
this->len = 0;
while (x)
{
this->a[++this->len] = x % 10;
x /= 10;
}
}
int &operator[](int k)
{
return this->a[k];
}
void flatten(int k)
{
for (int i = 1;i <= k;i++)
{
this->a[i+1] += this->a[i]/10;
this->a[i] %= 10;
}
int i = k;
while (this->a[i] == 0 && i > 1) i--;
this->len = i;
}
void print()
{
for (int i = this->len;i >= 1;i--)
{
cout << this->a[i];
}
cout << endl;
}
};
LLI operator+(LLI a,LLI b) //这一段不用,就当注释了
{
LLI c;
int size = max(a.len,b.len) + 1;
for (int i = 1;i <= size;i++)
{
c[i] += a[i] + b[i];
}
c.flatten(size + 3);
return c;
}
LLI operator*(LLI a,LLI b)
{
LLI c;
for (int i = 1;i <= a.len;i++)
{
for (int j = 1;j <= b.len;j++)
{
c[i+j-1] = a[i] * b[j];
}
}
c.flatten(a.len+b.len+5);
return c;
}
int main()
{
LLI a,b,c;
cin >> s >> t;
int lens = s.length(),lent = t.length();
for (int i = lens-1;i >= 0;i--)
{
a[lens-i] = s[i]-'0';
}
a.len = lens;
for (int i = lent-1;i >= 0;i--)
{
b[lent-i] = t[i]-'0';
}
b.len = lent;
c = a*b;
c.print();
return 0;
}
过不了......