#include "string"
using namespace std;
class BigInteger{
private:
string s;
string subtraction(string s1, string s2){
if (s1 == s2)
return "0";
while (s1.length() < s2.length())
s1 = '0' + s1;
while (s2.length() < s1.length())
s2 = '0' + s2;
s1 = '0' + s1;
s2 = '0' + s2;
for (size_t i = 1; i < s1.length(); i++){
if (s1[i] > s2[i])
s1[i] = s1[i] - s2[i] + '0';
else{
s1[i] = s1[i] + 10 - s2[i] + '0';
s1[i - 1]--;
}
}
return clearZero(s1);
return s1;
}
void strToInt(int *a, string b){ //b = "1234" then a = {4,3,2,1}
int length = b.length();
for (int i = 0; i < length; i++){
a[length - i - 1] = b[i] - '0';
}
}
string intToStr(int *a, int length){
string b;
for (int i = 0; i < length; i+&#
C++ 大数算术 BigInteger
最新推荐文章于 2018-08-07 17:44:01 发布