#include <iostream>
#include <vector>
#include <string>
#include <cstring>
using namespace std;
//存储高精度非负整数
struct BigInteger {
static const int BASE = 10000000; //10^8
static const int WIDTH = 8;
vector<int> s;
BigInteger(long long num = 0) {
*this = num; } //构造函数
BigInteger operator = (long long num) {
//赋值运算符 =num
s.clear();
do {
s.push_back(num % BASE);
num /= BASE;
} while(num > 0);
return *this;
}
BigInteger operator = (const string& str) {
//赋值运算符 =string
s.clear();
int x;
int len = (str.length() - 1)/WIDTH + 1;
for(int i =
【算法竞赛入门经典】大整数类 BigInteger

最新推荐文章于 2022-04-03 11:58:34 发布
