@Yezi.press
bigInt 大整数结构体
bigInt 大整数的结构体封装以及构造函数
算法模板更新于 2026年8月19日 13:01#高精度
C++17 行430 Bytes
struct bigInt {
int digit[1000] = {0}, len = 0;
// s 的默认值为 “0”,可以不用传参
bigInt (string s = "0") {
len = s.size();
for (int i = 0, j = len-1; i < len; i++, j--)
digit[i] = s[j] - '0';
}
void print() {
for (int i = len-1; i >= 0; i--)
cout << digit[i];
cout << endl;
}
};
bigInt a("66666666666666666666666666666");
a.print();