#include
#include
#include
#include
using namespace std;
const int MAX = 110;
class CHugeInt {
public:
int a[2 * MAX];
int len;
CHugeInt():len(0) { memset(a, 0, sizeof(a)); }
CHugeInt(char c[]){
memset(a, 0, sizeof(a));
len = strlen(c);
for (int i = 0;i < len; ++i) {
a[i] = c[len - 1 - i] - '0';
}
}
CHugeInt(int n){
memset(a, 0, sizeof(a));
if (n == 0) {
len = 1;
}
else {
int wei = 0;
while (n > 0) {
wei++;
a[wei - 1] = n % 10;
n = n / 10;
}
len = wei;
}
}
CHugeInt operator+ (CHugeInt & b) {
CHugeInt c;
int temp;
int ci = 0;
for (int i = 0;i < len || i < b.len; ++i) {
temp = a[i] + b.a[i] + ci;
ci = temp / 10;
c.a[c.len++] = temp % 10;
}
if (ci != 0) {
c.a[c.len++] = ci;
}
return c;
}
CHugeInt operator+ (int n) {
CHugeInt b = CHugeInt(n);
CHugeInt c;
int temp;
int ci = 0;
for (int i = 0;i < len || i < b.len; ++i) {
temp = a[i] + b.a[i] + ci;
ci = temp / 10;
c.a[c.len++] = temp % 10;
}
if (ci != 0) {
c.a[c.len++] = ci;
}
/* memcpy(a, c.a, sizeof(a));
len = c.len;*/
return c;
}
friend CHugeInt operator+ (int a, CHugeInt & b) {
return b + a;
}
operator char* () {
static char res[2 * MAX];
for (int i = 0;i > s >> n) {
CHugeInt a(s);
CHugeInt b(n);
cout << a + b << endl;
cout << n + a << endl;
cout << a + n << endl;
b += n;
cout << ++ b << endl;
cout << b++ << endl;
cout << b << endl;
}
return 0;
}