You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include "BigInteger.h"
#include <iostream>
int main() {
// 创建大整数对象
BigInteger a("12345678901234567890");
BigInteger b("98765432109876543210");
// 执行算术运算
std::cout << "加法结果: " << (a + b) << std::endl;
std::cout << "乘法结果: " << (a * b) << std::endl;
return 0;
}
🐦🔥复合赋值运算符
BigInteger a("100");
BigInteger b("50");
a += b; // 等价于 a = a + b
a -= b; // 等价于 a = a - b
a *= b; // 等价于 a = a * b
a /= b; // 等价于 a = a / b
a %= b; // 等价于 a = a % b