#include <iostream>
#include <vector>
#include <string>
#include <cstring>
using namespace std;
class bign {
public :
//4个必须函数
bign(string str) {
char * ch = new char[str.length()];
strcpy(ch,str.c_str());
for (int i=str.length()-1; i>=0; --i) this->bnArr.push_back(int(ch[i])-48);
this->length = bnArr.size();
}
int * bnA() {
int * bnAS = new int[this->length];
for (int i=0; i<this->length; ++i)
bnAS[i] = this->bnArr[i];
return bnAS;
}
int len() {
return this->length;
}
void chPrivate(string str) {
this->bnArr.clear();
char * ch = new char[str.length()];
strcpy(ch,str.c_str());
for (int i=str.length()-1; i>=0; --i) this->bnArr.push_back(int(ch[i])-48);
this->length = this->bnArr.size();
}
//add()不用其他函数
string add(bign a) {
vector<int> tempT;
vector<int> tempA;
vector<int> sum;
vector<char> sumCh;
string sumStr="";
for(int i=0; i<this->length; ++i) tempT.push_back(this->bnArr[i]);
for(int i=0; i<a.len(); ++i) tempA.push_back(a.bnA()[i]);
if(tempT.size() > tempA.size())
while(tempA.size() < tempT.size()) {
tempA.push_back(0);
}
if(tempT.size() < tempA.size())
while(tempA.size() > tempT.size()) {
tempT.push_back(0);
}
int bey=0;
for(vector<int>::iterator it1=tempT.begin(),it2=tempA.begin(); it1!=tempT.end(); ++it1,++it2) {
sum.push_back(((*it1)+(*it2)+bey)%10);
bey = ((*it1)+(*it2)+bey)/10;
}
if(bey) sum.push_back(bey);
for (int i=0; i<sum.size(); +