BigInteger类表示不超过1000位的无符号大整数。试重载>>
,<<
和*
,以支持无符号大整数的输入、输出与乘法。
重载面向BigInteger类对象的运算符:
>>
<<
*
裁判测试程序样例:
#include <iostream>
#include <string>
using namespace std;
/* 请在这里填写答案 */
int main()
{
BigInteger a, b, c;
cin >> a >> b;
c = a * b;
cout << a << "*" << b << "=" << c << endl;
return 0;
}
输入样例:
123456789
987654321
输出样例:
123456789*987654321=121932631112635269
请高手指点,有没有更简单的方法
#include <iostream>
#include <string>
using namespace std;
/* 请在这里填写答案 */
class BigInteger{
private:
int big[2010];
string a;
public:
BigInteger(string ba=""){