#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 1e5;
struct INT
{
int a[N];
INT()
{
memset(a,0,sizeof(a));
}
void rd()
{
char s[N];
scanf("%s",s);
a[0] = strlen(s);
for(int i = 1; i <= a[0]; i++)
a[i] = s[a[0] - i] - ‘0‘;
return;
}
void print()
{
for(int i = a[0]; i >= 1; i--)
printf("%d",a[i]);
puts("");
return;
}
INT operator + (const INT &b) const
{
INT c;
c.a[0] = max(a[0],b.a[0]);
for(int i = 1; i <= c.a[0]; i++)
{
c.a[i] += a[i] + b.a[i];
c.a[i + 1] += c.a[i] / 10;
c.a[i] %= 10;
}
if(c.a[c.a[0] + 1]) c.a[0]++;
return c;
}
bool operator < (const INT &b) const
{
if(a[0] != b.a[0]) return a[0] < b.a[0];
for(int i = a[0]; i >= 1; i--)
if(a[i] != b.a[i]) return a[i] < b.a[i];
return false;
}
INT operator - (INT b) const
{
INT t;
memcpy(t.a,a,sizeof(a));
if(t < b)
{
printf("-");
swap(t,b);
}
for(int i = 1; i <= t.a[0]; i++)
{
if(t.a[i] < b.a[i]) t.a[i] += 10, t.a[i + 1]--;
t.a[i] -= b.a[i];
}
while(t.a[0] > 1 && !t.a[t.a[0]]) t.a[0]--;
return t;
}
INT operator * (const INT &b) const
{
INT c;
for(int i = 1; i <= a[0]; i++)
{
int w = 0;
for(int j = 1; j <= b.a[0]; j++)
{
c.a[i + j - 1] += a[i] * b.a[j] + w;
w = c.a[i + j - 1] / 10;
c.a[i + j - 1] %= 10;
}
c.a[i + b.a[0]] += w;
}
c.a[0] = a[0] + b.a[0];
if(!c.a[c.a[0]]) c.a[0] --;
return c;
}
} a,b,c;
int main()
{
a.rd();
b.rd();
// c = a + b;
// c = a - b;
// c = a * b;
c.print();
return 0;
}
高精度模板