//高精度加法
#include<iostream>
#include<string>
using namespace std;
string adda, addb;
int a[201]; int b[201],c[401];
void add_reverse(string adda,int a[])
{
for (int i = 0; i < adda.size(); i++)
{
a[adda.size() - i] = adda[i] - '0';
}
}
int main()
{
cin >> adda >> addb;
add_reverse(adda, a);
add_reverse(addb, b);
int la = max(adda.size(), addb.size()) + 1;
for (int i = 1; i <= la; i++)
{
c[i] += a[i] + b[i];
c[i + 1] = c[i] / 10;
c[i] = c[i] % 10;
}
while (c[la] == 0 && la > 1)la--;
for (int i = la; i >= 1; i--)
{
cout << c[i];
}
return 0;
}
//高精度减法
#include<iostream>
#include<string>
using namespace std;
string s1, s2;
int a[101], b[101], c[201];
void minus_reverse(string s,int a[])
{
for (int i = 0; i < s.size(); i++)
{
a[s.size() - i] = s[i] - '0';
}
}
bool cmpstr(string s1, string s2)
{
if (s1.size() != s2.size())
{
return s1.size() >= s2.size();
}
else
{
return s1 >= s2;
}
}
int main()
{
cin >> s1 >> s2;
if (cmpstr(s1, s2) == false)
{
swap(s1, s2);
cout << '-';
}
minus_reverse(s1, a);
minus_reverse(s2, b);
int la = max(s1.size(), s2.size());
for (int i = 1; i <= la; i++)
{
if (a[i] < b[i])
{
a[i + 1]--;
a[i] += 10;
}
c[i] = a[i] - b[i];
}
while (c[la] == 0 && la > 1)la--;
for (int i = la; i >= 1; i--)
{
cout << c[i];
}
return 0;
}
//高精度乘法
#include<iostream>
using namespace std;
string s1, s2;
int a[201], b[201], c[201];
void reverse(string s,int a[])
{
for (int i = 0; i < s.size(); i++)
{
a[s.size() - i] = s[i] - '0';
}
}
int main()
{
cin >> s1 >> s2;
reverse(s1, a);
reverse(s2, b);
int lc = s1.size() + s2.size();
for (int i = 1; i <= s1.size(); i++)
{
for (int j = 1; j <= s2.size(); j++)
{
c[i + j - 1] += a[i] * b[j];
c[i + j] += c[i + j - 1] / 10;
c[i + j - 1] %= 10;
}
}
while (c[lc] == 0 && lc > 1)lc--;
for (int i = lc; i >= 1; i--)
{
cout << c[i];
}
return 0;
}